ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 248 seconds]
<FromGitter> <jsilverMDX> we got chat history saving now j/s
<FromGitter> <jsilverMDX> :D
<FromGitter> <jsilverMDX> fixed safari as well
snsei_ has quit [Remote host closed the connection]
JMatt has joined #crystal-lang
<JMatt> this may be a very dumb question, but why can't "puts" render a \
<JMatt> nvm i got it just use it twice
JMatt has quit [Quit: Page closed]
<FromGitter> <codenoid> can i call a function with `Process.new` ? https://play.crystal-lang.org/#/r/2qog
Philpax__ has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
<FromGitter> <bararchy> @codenoid no, as a fuction is not a process
<FromGitter> <bararchy> but you can `fork` it
<FromGitter> <bararchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59bf62bd210ac2692044b000]
alex`` has joined #crystal-lang
Papierkorb_ has joined #crystal-lang
<Groogy> Morning!
<Papierkorb_> Moin
mark_66 has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
Papierkorb has quit [Ping timeout: 240 seconds]
<FromGitter> <sdogruyol> Morning and have a nice week everyone
<FromGitter> <bew> Thanks ;) you too
rohitpaulk has joined #crystal-lang
snsei has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snsei has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #crystal-lang
<FromGitter> <codenoid> @bararchy is `fork do` with `spawn do` different ?
<FromGitter> <bararchy> @codenoid fork creates a different process for the code in the block, while spawn create a new fiber to handle it
<FromGitter> <codenoid> got it , lemme try,
<FromGitter> <bararchy> @codenoid https://crystal-lang.org/api/0.22.0/Process.html#fork%28%26block%29-class-method
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
flaviodesousa has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
<FromGitter> <codenoid> @bararchy ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59bf8d47bac826f054d007aa]
<FromGitter> <codenoid> mydata = 200_000 # + .size data ⏎ (0...mydata).each do |v| ⏎ fork do ⏎ ⏎ ``` puts "pusss meong"``` ... [https://gitter.im/crystal-lang/crystal?at=59bf8ddeb59d55b8230d7ced]
<FromGitter> <Rinkana> Why would you want to spawn 200000 processes?
<FromGitter> <Rinkana> That seems, excessive.
<FromGitter> <codenoid> same error when i use `sleep x.minute` too
<FromGitter> <codenoid> wait, i'll change the flow and total data
<FromGitter> <bew> @codenoid what is the full error?
<FromGitter> <codenoid> my code has been fixed ,
<FromGitter> <codenoid> @bew a random message
<FromGitter> <codenoid> `0x100b53599: ~proc2Proc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal-lang/0.23.1/src/fiber.cr:29 at ??`
<FromGitter> <bew> ok cool
<FromGitter> <Enether> Yo guys, I just wrote an introductory blog post to the language
<FromGitter> <Enether> can anybody please review my draft and help me improve some sections?
<Groogy> reading it but I am not the best person at English so don't expect much xD
<Papierkorb_> > Okay, they look identical but how much faster is Crystal?
<Papierkorb_> > Initializing class instance variables directly in the initialize() method <- Actually possible with any method
<Papierkorb_> Enether,
<FromGitter> <Enether> That’s me
<Papierkorb_> Overall a good document for people coming from Ruby. Maybe add a super short description what an AA Tree is
<FromGitter> <Enether> Would that be in place? I did link to the wiki
<FromGitter> <Enether> I don’t know if I can describe it in a short way haha
<Papierkorb_> just roughly. it's just so that people who don't wanna read some long wikipedia article have a rough idea what it's for
<Papierkorb_> You don't have to explain how it works
rohitpaulk has quit [Ping timeout: 264 seconds]
bmcginty has quit [Ping timeout: 240 seconds]
bmcginty has joined #crystal-lang
rohitpaulk has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #crystal-lang
olbat[m]1 has quit [Ping timeout: 240 seconds]
Liothen has quit [Ping timeout: 240 seconds]
Liothen has joined #crystal-lang
<FromGitter> <codenoid> ups :# ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59bfa27acfeed2eb65228cb6]
olbat[m]1 has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
rohitpaulk has quit [Ping timeout: 246 seconds]
<FromGitter> <bararchy> @codenoid The different between threads, processes and Fibers is vast, trying to spawn above 50-100 processes is absurd , it uses alot of resources and it makes sense you got to Out of memory
<FromGitter> <bararchy> please, use spawn
<FromGitter> <bararchy> or fork only if you know you should
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] asterite closed pull request #2898: Add missing PartialOrder#<=> (master...fix/partial_order-ufo) https://git.io/vo1iH
rohitpaulk has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
ShalokShalom_ has joined #crystal-lang
ShalokShalom has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <codenoid> but i just run it for 1 time (1 process)
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
<FromGitter> <bararchy> Hm.... It seems you got 2 errors, EOF = try to read a file (or socket) while the socket was closed (EOF) ⏎ and the 2nd one just means you got non memory to create a new Process
claudiuinberlin has joined #crystal-lang
<crystal-gh> [crystal] akzhan opened pull request #5000: use Crystal::Hasher and openaddressing in StringPool (master...stringpool-openaddressing) https://git.io/v5bsD
<travis-ci> crystal-lang/crystal#5c51ed1 (master - Merge pull request #2898 from MakeNowJust/fix/partial_order-ufo): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/276813604
<DeBot_> https://github.com/crystal-lang/crystal/pull/2898 (Add missing PartialOrder#<=>)
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
<FromGitter> <bew> @codenoid what is your crashing code?
ShalokShalom_ is now known as ShalokShalom
<FromGitter> <makotofu_twitter> hi anyone know the crystal equivalent of ``` ⏎ crystal threads.cr ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=59bfc364cfeed2eb6523402a]
<FromGitter> <makotofu_twitter> which is in ruby and it prints 1 and 2 both at the same time
<FromGitter> <makotofu_twitter> alright thanks, ill check it out
<FromGitter> <ziprandom> hey all, trying to turn this ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ into a crystal string, ```String.new ref.ptr, ref.size``` doesn't work ... [https://gitter.im/crystal-lang/crystal?at=59bfc42e177fb9fe7ed67f80]
hightower4 has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snsei has joined #crystal-lang
hightower3 has quit [Ping timeout: 255 seconds]
<FromGitter> <bew> @ziprandom can you reduce an example?
snsei has quit [Ping timeout: 246 seconds]
<FromGitter> <bew> seems to work by itself https://carc.in/#/r/2qv8
<FromGitter> <ziprandom> @bew its what I get out of a c function in libgit2 `filter_content` https://github.com/mosop/git/blob/master/src/lib/c/auto_generated.cr#L420
<FromGitter> <bew> what kind of errors do you get?
adam_ is now known as adam12
<FromGitter> <papilip> Hi all, I am pleased to announce my first program with Crystal : ⏎ helptransl8 => https://github.com/papilip/helptransl8 ⏎ Return welcome
<FromGitter> <sdogruyol> @papilip welcome, and congrats on your first Crystal shard 🎉
LastWhisper____ has joined #crystal-lang
<FromGitter> <ziprandom> @bew I get Invalid memory access, this is the most simple example I have. It's probably a mixture of not understanding libgit2's api and c in general https://pastebin.com/mUdihx62
<FromGitter> <ziprandom> @bew, there was a regression, this is the snippet that illustrates the problem: https://pastebin.com/wfwENJ8C
<FromGitter> <ziprandom> the git shard is: https://github.com/mosop
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
<FromGitter> <bew> @ziprandom what are you trying to do with this snippet?
<FromGitter> <bew> I got it crashing, then I added the file "test.txt" (as stated in the code), and it printed `strings[0] # => "\u0000\u0000\u0000\u0000\x90`
bjmllr has left #crystal-lang ["WeeChat 1.0.1"]
<FromGitter> <papilip> @sdogruyol many thanks
<FromGitter> <ziprandom> @bew sorry, the example had flaws like the hardcoded file name. I'm trying to use the shard (and the bindings) to list all files in the repo and get their contents.
<FromGitter> <ziprandom> this example is better: https://gist.github.com/ziprandom/e6876924eea3a955f61d2d3c22a49ca3
<FromGitter> <ziprandom> what it prints doesn't reflect the actuall content of the file ..
<FromGitter> <bew> for my .gitignore I get a size of 140411259312188... there is sth wrong somewhere...
<FromGitter> <krypton97> is it a bad practice to call c code through stdout?
<FromGitter> <bew> Oo what do you mean?
<FromGitter> <krypton97> spawn a process, execute a c binary and collect the output
<FromGitter> <krypton97> to be used within another language
<FromGitter> <bew> I don't like it, because in most cases you need to parse the output you get, and I feel it's not as clean as it could be, but that my OCD playing here. Generally I don't think that's a bad practice for simple things
<FromGitter> <krypton97> I don't like it eaither, but it's blazing fast
<FromGitter> <ziprandom> @bew `blob_rawcontent` might be more promising, but I don't know how to interpret ` Void*` as a string ...
<FromGitter> <bew> why do you use the raw C bindings directly instead of using the wrapper made by mosop?
Papierkorb_ has quit [Quit: Konversation terminated!]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <ziprandom> @bew mosop's wrapper is incomplete, i'm trying to create the part of the wrapper that does what I want..
tax has joined #crystal-lang
Papierkorb has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
linuksz has joined #crystal-lang
<linuksz> I have a Position class. The initialize method requires two arguments: @x, and @y. Is it possible to create a range of Positions?
<linuksz> something similar to Position.new(0,0)..Position.new(2,3)
<Papierkorb> that's how you do it
<linuksz> what methods should i define for Position?
<Papierkorb> #< and #succ
<linuksz> but how can i define succ, when initialize requires two arguments
<Papierkorb> mh? You return a new position from that.
<Papierkorb> If there is no sane way of doing that, then there's no sane way to #each over that range in any case.
<linuksz> but how can succ know when @x should be incremented or @y?
<Papierkorb> It doesn't. If you can't know, then #succ and thus #each doesn't make sense.
<linuksz> so it is not possible, is it?
<Papierkorb> if you can't find a reasonable way for it, no
<linuksz> ok, i will try to find another solution
<RX14> ranges are meant for 1d
<FromGitter> <bew> @ziprandom oh ok, didn't know it wasn't complete. To interpret a `Void*` as string, you can cast it to `UInt8*` then build a String from it `String.new(ptr)`, or if you know the size `String.new(ptr, size)` I think.
<RX14> perhaps a better design could be found that allows 2d but...
<RX14> i dont think its worth it
<FromGitter> <bew> @ziprandom but it feels weird that you get a Void* and not a UInt8*
<FromGitter> <ziprandom> @bew, thxx. I guess the problem is that I don't fully understand the api ..
<Papierkorb> RX14: Let's allow to override operator `..` *hides*
<RX14> noooo
<RX14> not C++cr
<Papierkorb> But .. overloading || is hilarious?
<FromGitter> <bew> @ziprandom did you tried to follow some C tutorial with the raw bindings?
<FromGitter> <ziprandom> @bew yeah I looked into other, more complete library wrappers in other languages
<linuksz> https://play.crystal-lang.org/#/r/2qy2 what should i modify in this code to print 10? ( without changing the method name)
<Papierkorb> in an instance method? `self.width`
<linuksz> doesn't work
<FromGitter> <bew> linuksz ^
<linuksz> thanks.
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 248 seconds]
p0p0pr37_ is now known as p0p0pr37
claudiuinberlin has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
<FromGitter> <bararchy> @sdogruyol This part though .. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59bff2e6b59d55b8230fd37d]
<FromGitter> <sdogruyol> That's a bit confusing
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
rohitpaulk has joined #crystal-lang
linuksz has quit [Quit: Leaving.]
rohitpaulk has quit [Ping timeout: 260 seconds]
Philpax_ has joined #crystal-lang
Philpax__ has quit [Ping timeout: 246 seconds]
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
snsei has quit [Ping timeout: 264 seconds]
sz0 has joined #crystal-lang
<crystal-gh> [crystal] oprypin opened pull request #5003: Change Errno into a hierarchy of OSError subclasses (master...oserror) https://git.io/v5bAY
p0p0pr37 has quit [Ping timeout: 252 seconds]
p0p0pr37 has joined #crystal-lang
<FromGitter> <jsilverMDX> hey guys, does anyone know the properly way to get a remote ip from a http request object?
<FromGitter> <jsilverMDX> request.host is not it
<oprypin> jsilverMDX, the request does not know the ip
<oprypin> not sure if there is a way :o
<oprypin> i'd expect the context to contain some info
linuksz has joined #crystal-lang
<FromGitter> <jsilverMDX> how do I get at the context?
<FromGitter> <jsilverMDX> it's context.right?
<FromGitter> <jsilverMDX> found this
<linuksz> why isn't initialized? https://play.crystal-lang.org/#/r/2qze
<oprypin> linuksz, initialization through calling other methods is not detected
<linuksz> oprypin, why?
<oprypin> i dunno, it's difficult
<linuksz> will it ever implemented?
<oprypin> i give about 20% likelihood
<oprypin> (i'm just an outsider taking a guess though)
<FromGitter> <jsilverMDX> the context doesnt contain anything that will help
<FromGitter> <jsilverMDX> really dont wanna install nginx
<FromGitter> <ezrast> @linuksz It's so the compiler doesn't have to do a bunch of code flow analysis to figure out if variables are initialized
<linuksz> so what can i do?
<FromGitter> <ezrast> stupid example, https://play.crystal-lang.org/#/r/2qzf always gets initialized (or overflows the stack) but having the compiler figure that out isn't worth the effort and CPU cycles
<FromGitter> <ezrast> just give everything a default value and then call your other method
<linuksz> But it is difficult when it is a custom class
<FromGitter> <ezrast> not sure what you mean by a custom class
<linuksz> e.g. a window
<linuksz> a termbox window
<linuksz> it gets initialized in a separate method
<linuksz> and the variable can't get a default value, because Termbox::Window.new sets low level terminal flags
<FromGitter> <ezrast> can you have that separate method return the window object? then just do `@window = make_window_method` in your constructor?
<linuksz> def make_window_method
<linuksz> @window = Window.new
<linuksz> end
<linuksz> so it directly sets the variable, not only return
<FromGitter> <bew> I think it's better design to return, without setting the instance variable
<FromGitter> <ino76> hi .. does anybody know some easy algorithm to show "speed" through languages? PS: btw did you try Nim lang? What do you guys think about it compared to Crystal?
<FromGitter> <ezrast> Depends, `make_window_method` could be a public method setting a private attribute
<FromGitter> <ezrast> Never mind, that doesn't make sense
<Papierkorb> ino76, "show speed through languages"?
<FromGitter> <bew> True @ezrast , but in this case you'd probably want to have a private method that builds the window, and return it. And this could be transparently be used without side effects in a setter or the constructor
<FromGitter> <ino76> @FromIRC :) .. somethink like this >> http://benchmarksgame.alioth.debian.org But because I am not so skilled in programming, I need some not so hard algorithms. And why? Because it is fun to measure it a try to progam in different languages.
<Papierkorb> Oh that you mean
<oprypin> why is circleci broken? can't expand "bin/ci build" https://circleci.com/gh/crystal-lang/crystal/1120
<FromGitter> <ino76> @FromIRC oh hi Bot
<Papierkorb> ino76, All of these algorithms are micro benchmarks. You shouldn't base your opinion of a language solely on their execution speed at all. But you can implement them as check how the language feels of course.
<Papierkorb> ino76, Though really, for that you don't need to know some specific algorithm. Set a goal, like "implement a webpage offering a really simple REST-based calculator". And then set out and implement it in all languages you want to try.
<Papierkorb> After that, you can compare the results. If a language is really "fast", but is awful to write, what gives?
<FromGitter> <ino76> thats exactly what I meant .. speed comparison is just for fun, but implementing some proglem in different languages is a good lesson. Thx for advice.
<FromGitter> <sdogruyol> wow @oprypin such an interesting pr https://github.com/crystal-lang/crystal/pull/5003
<oprypin> thx
<oprypin> Python sure is interesting....
<FromGitter> <sdogruyol> like?
<FromGitter> <sdogruyol> their exception stuff?
<oprypin> sdogruyol, i mean this is mostly ripped off from Python
<FromGitter> <sdogruyol> ah i see
<FromGitter> <sdogruyol> is there an any other namespace than OSERROR in this case?
<oprypin> not sure what u mean
<FromGitter> <sdogruyol> OSError::ENOENT
<FromGitter> <sdogruyol> the namespace is always the same
<FromGitter> <sdogruyol> ugh my bad
<FromGitter> <sdogruyol> that's for windows?
<oprypin> WindowsError is for Windows
<FromGitter> <sdogruyol> now I get it, I shouldn't take a look at that big PRs in a small screen :P
<FromGitter> <sdogruyol> thanks again @oprypin
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
alex`` has quit [Quit: WeeChat 1.9]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
gokmen has joined #crystal-lang
<Papierkorb> Is there a way to mark an `it` spec as failing?
<Papierkorb> Oh wait, it won't compile anyway if I leave it in.
gokmen has quit [Quit: I'll be back.]
gokmen has joined #crystal-lang
<oprypin> im going crazy. how do i see the damn failure in https://circleci.com/gh/crystal-lang/crystal/1122 instead of the spinning circle
<FromGitter> <sdogruyol> the page is not opening for me lol
<Papierkorb> works here
<oprypin> Papierkorb, paste the whole thing for me i dunno lol
<oprypin> thx
claudiuinberlin has joined #crystal-lang
linuksz has quit [Ping timeout: 248 seconds]
claudiuinberlin has quit [Client Quit]
rohitpaulk has quit [Ping timeout: 252 seconds]
<Yxhuvud> hmm, is it normal to get " /var/cache/omnibus/src/llvm/llvm-3.8.1.src/lib/CodeGen/LexicalScopes.cpp:160: llvm::LexicalScope* llvm::LexicalScopes::getOrCreateRegularScope(const llvm::DILocalScope*): Assertion `cast<DISubprogram>(Scope)->describes(MF->getFunction())' failed. " when building with releaseflag?
<oprypin> Yxhuvud, normal in the sense that everyone on Ubuntu gets it
<oprypin> not normal that this still isnt fixed -___-
<oprypin> Yxhuvud, use --no-debug
<Yxhuvud> ok, then I guess I won't report it.
<oprypin> at least if this is the error i think it is
<Yxhuvud> seems to have worked.
<oprypin> dang it, on macos removing a directory with `remove` says permission error
<oprypin> even Python has a PermissionError on Mac but IsADirectoryError on Linux, sigh
claudiuinberlin has joined #crystal-lang
<Papierkorb> That sucks.
<Papierkorb> Can we do better?
<oprypin> Papierkorb, probably not in a sane way
<oprypin> maybe check for PermissionError and then see if its' actually a directory but even that is error prone
gokmen has quit [Quit: I'll be back.]
<oprypin> because deleting a forbidden directory gives PermissionError too
<oprypin> however it seems like `rm` command line tool actually first checks if it's a directory
<Papierkorb> It'd be fine I think if rm fails to just check if it's a directory
<Papierkorb> Should at least reduce the risk of (impossible?) false-positives and race conditions, while offering better error reporting
<oprypin> i dont understand your point
<Papierkorb> If the unlink() failed, check if it was a directory afterwards
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
<ShalokShalom> Papierkorb: Can i consider your binding as stable now?
<ShalokShalom> For the Qt Wiki.
<Papierkorb> I'm not absent from the project, I'm working on something. They're alpha, and should be considered as such at least until the ABI issue in the Crystal compiler is fixed
<oprypin> whats that?
<oprypin> mm thats fun
<oprypin> but that shouldnt stop u, there are workarounds probably
<Papierkorb> There are not.
<Papierkorb> Or at least none I would want to put into bindgen
<oprypin> -_-
<Papierkorb> This is a issue that needs to be fixed right where it occurs. I'm pretty sure this would drive people insane who stumble upon it with lesser knowledge of C and stuff
<Papierkorb> I mean I was baffled at first too, as you can see in there, I assumed an alignment issue at first
<oprypin> yes but qt is more important than all other bindings so whatever
DTZUZO has quit [Read error: Connection reset by peer]
DTZUZO has joined #crystal-lang
<oprypin> maan i'm old
<oprypin> just say no to structs
<Papierkorb> What part is wrong exactly?
<oprypin> nothing wrong, just avoid structs to avoid errors
<oprypin> pass strings as 2 args
<Papierkorb> No, that wouldn't solve everything. I have to return a struct when passing a string back from a virtual override
<oprypin> Papierkorb, haha no, you don't ever have to return anything
<Papierkorb> Isn't that issue fixed?
<oprypin> that issue is fixed but it took pretty damn long
<Papierkorb> Yeah please no hidden return struct
<Papierkorb> Sure did
<oprypin> Papierkorb, no, just "out arguments"
<oprypin> and im pretty sure your issue title could change from "parameters" to "structs" without losing generality
DTZUZU has quit [Ping timeout: 255 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
<oprypin> char** result, int* result_size
DTZUZO has joined #crystal-lang
DTZUZU has joined #crystal-lang
<Papierkorb> Yeah and now for every structure
<Papierkorb> [_] Sounds like fun
<Papierkorb> That being said, neither Qt.cr nor bindgen are 'dead'. Not even "dormant but maintained". I wasn't sleeping the past weeks. May take another week though. (I'm offline this weekend, weee)
<oprypin> Papierkorb, why dont u pass const QChar *QString::constData() to Crystal and let it deal with that?
<oprypin> instead of converting and (omg) invoking GC alloc
<oprypin> oh probably because stack gets deleted
<oprypin> Papierkorb, I found the way that you include a table of all virtual methods in every object really inefficient. why not make the struct global?
Philpax__ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 246 seconds]
<oprypin> and the default Crystal implementation calls the base C++ implementation
nhcham has joined #crystal-lang
<nhcham> Hello
nhcham has quit [Client Quit]
<FromGitter> <georgeu2000> Is there a way to do `5.downto(1).map do | i |`?
<RX14> that doesn't work?
<RX14> oh, maybe you're missing the to_a at the end?
<RX14> the 5.downto(1) returns an iterator
<RX14> and then the #map call returns an iterator which wraps the previous
<RX14> so if you want an array you need to use #to_a
<RX14> if you just need to use #each on it, you can use it as-is though
<RX14> @georgeu2000 ^
<FromGitter> <georgeu2000> Hmm...now it works. Thanks!
sz0 has quit [Quit: Connection closed for inactivity]