<unshadow>
jhass, I know what's your next project should be ! a build bot ! :)
<unshadow>
with containers of like 5 different dists, I upload code, and get back 5 named Bineries
datanoise has quit [Ping timeout: 258 seconds]
ponga has quit [Read error: Connection reset by peer]
JBat has joined #crystal-lang
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
havenwood has quit [Ping timeout: 245 seconds]
datanoise has joined #crystal-lang
datanoise has quit [Ping timeout: 240 seconds]
BlaXpirit has joined #crystal-lang
Ven has joined #crystal-lang
ponga has quit [Quit: Leaving...]
DerisiveLogic has quit [Ping timeout: 244 seconds]
datanoise has joined #crystal-lang
datanoise has quit [Ping timeout: 264 seconds]
<unshadow>
Something wierd... or not XD In Ruby I can do this: "char_gender = gets until char_gender =~ /(f|m)/i", in crystal I get the following error: "read before definition of 'char_gender'"
<unshadow>
I guess this has something to do with the compiler not knowing what the defenition of char_gender is going to be... or that it tries to create a loop with an undefined object
<unshadow>
But how does it work in Ruby then ?
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leafybasil has quit [Remote host closed the connection]
<chrisseaton>
Hi - I'm having trouble getting started with Crystal. I've installed via HomeBrew. I try crystal build test.cr, and I get: Error: execution of command failed with code: 1: `cc -o test .crystal//Users/chrisseaton/Documents/ruby/jruby/test.cr/main.o etc etc etc
Benoist has joined #crystal-lang
<Benoist>
Hi guys
<Benoist>
I've just published a msgpack unpacker implementation. I'd love some feedback before I start implementing the packer
<unshadow>
jhass: how do I get back output from Process.run ?
<jhass>
the output parameter can be true, then Process:Status#output will be populated, or you can set it to any kind of IO object, then the output will be written to it
<unshadow>
>> a = Process.run("ls", "-la", STDOUT)
<DeBot>
unshadow: in /usr/lib/crystal/process/run.cr:8: undefined method 'each' for String - http://carc.in/#/r/cy
<jhass>
probably not too hard, just time consuming
Ven has joined #crystal-lang
Ven_ has joined #crystal-lang
Ven has quit [Ping timeout: 276 seconds]
leafybasil has joined #crystal-lang
shama has joined #crystal-lang
leafybas_ has quit [Ping timeout: 256 seconds]
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aemadrid has joined #crystal-lang
<tkrajcar>
anyone know if waj is on irc ever?
<jhass>
rarely
<jhass>
but it does happen
<jhass>
tkrajcar: try /msg NickServ INFO waj
<tkrajcar>
oh neat, I didn't know nickserv could do that.
jua_ has joined #crystal-lang
wanderer_ has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 244 seconds]
leafybasil has quit [Remote host closed the connection]
<chrisseaton>
I'm trying to build Crystal on the Mac. The instructions say not to use LLVM from homebrew, but the Makefile specifically looks for it there. What do I do?
<wanderer_>
shouldn't sizeof() return a LibC::SizeT value insteaf of Int32?
<wanderer_>
jhass: hi :) do you know how to get a void pointer to `var :: LibC::IntT` as Void Pointer? `pointerof(var) as Void*` gives me "can't cast Int32 to Pointer(Void)"
<datanoise>
chrisseaton: brew install llvm36
<datanoise>
chrisseaton: i think it should also work if you do $ brew install llvm
<datanoise>
since homebrew upgraded it to verion 3.6
<chrisseaton>
datanoise: ok, but the problem I now get is "Error: No available formula for llvm36", which is true it's called just 'llvm' I think
<jhass>
chrisseaton: didn't have the brew formula a --with-llvm flag or something?
* jhass
not a mac user
strcmp1 has joined #crystal-lang
<datanoise>
chrisseaton: my guess is that homebrew deleted llvm36 formula after upgrading to 3.6
<chrisseaton>
ok if I change the Makefile to llvm from llvm36 it works
<jhass>
first pull request opportunity! \o/
<datanoise>
yep :)
<chrisseaton>
I guess none of the core team uses Mac regularly?
leafybasil has joined #crystal-lang
asterite has joined #crystal-lang
asterite has quit [Client Quit]
<wanderer_>
jhass: oh, actually it was another parameter that was causing the error which happens to be an Int32, my bad, ehm, how would I interpret that correctly as a void pointer?
<jhass>
interpret?
<jhass>
chrisseaton: actually they both use macs afaik, I guess the never updated?
<wanderer_>
it's like an uintptr_t
<jhass>
I have not the slightest idea what that is ;)
<wanderer_>
it's just an address
<wanderer_>
and I want to pass it as Void*
<jhass>
what's the error?
<wanderer_>
the one from earlier, can't cast Int32 to Pointer(Void)
<jhass>
ah
<chrisseaton>
Whenever I run the Makefile after my first build it always says nothing to do, due to this .build file
<jhass>
Pointer(Void).new ptr
<wanderer_>
thx :)
<jhass>
chrisseaton: sounds like it compiled correctly?
<jhass>
check with bin/crystal version
<chrisseaton>
yeah, but then I change things, and it doesn't want to build it again
<jhass>
hum
<jhass>
that issue I never had
<jhass>
but you can workaround with touch src/compiler/crystal.cr I guess
<crystal-gh>
[crystal] waj pushed 1 new commit to master: http://git.io/vTMwN
<crystal-gh>
crystal/master e87ce77 Juan Wajnerman: Channels can send an receive values
leafybasil has quit [Remote host closed the connection]
<wanderer_>
jhass: where is sizeof used elsewise? I'd guess functions that expect a parameter that probably needs a sizeof should also expect it to be UInt32/UInt64, but yes I'm mostly thinking of C binding atm
<wanderer_>
also atm sizeof doesn't work with variables, does it? sizeof(type) is actually bad practice
<DeBot>
jhass: Error in line 4: undefined local variable or method 'goto' - http://carc.in/#/r/e6
<wanderer_>
what a shame
<jhass>
not really :P
<jhass>
we don't have ruby's weird throw/catch either, luckily!
<wanderer_>
I don't really like pascal-like code which looks like from a control flow graph
<wanderer_>
sometimes goto and another exit point is much nicer than saving results in variables and unrolling every loop, etc.
<jhass>
I think in most cases somebody was just too lazy to extract something into a small method
waterlink has joined #crystal-lang
<jhass>
it's amazing how many mid level returns you can avoid even, just by bit rearrangement
leafybasil has joined #crystal-lang
<wanderer_>
e.g. if you have a file open and there are multiple error conditions, on error you return 0 and have to close the file, "goto error; error: close(file); return 0" would come in handy
<wanderer_>
elsewise you'd need to repeat that "close(file); return 0" for every error condition
<jhass>
ensure; close(file) if file && file.open?
<jhass>
and then just raise for the error condition
<wanderer_>
this however would induce overhead and is kinda something I meant with "saving results in variables and unrolling every loop" with an `error: ...` you wouldn't need checks like `if file && file.open?`
<jhass>
well, a sane file.close would do that check anyhow
<jhass>
I don't see a nil check as problematic as the harder to follow control flow of goto
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vTyTS
<crystal-gh>
crystal/master 695f839 Ary Borenszweig: Added AutoflushBufferedIO and use it for STDOUT. Removed CFileIO
<wanderer_>
hm, C is different in regards to such checks because they are mostly superfluous if you're coding tidy