ismaelga has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 265 seconds]
ismaelga has joined #crystal-lang
havenwood has quit [Remote host closed the connection]
ismaelga has quit [Remote host closed the connection]
conorreedy1 has quit [Quit: conorreedy1]
petercommand has quit [Quit: leaving]
ismaelga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
havenwood has joined #crystal-lang
havenwood has joined #crystal-lang
swistak35 has joined #crystal-lang
<swistak35>
hello
<swistak35>
tried to write simple crystal program, stuck at one thing
<swistak35>
crystal eval 'foo = gets; puts foo' does work, but 'foo = gets; puts foo.size' doesn't
<swistak35>
from error message it looks like `foo` was nil, but it didn't even gave me a chance to type some input?
<jhass>
swistak35: when you press Ctrl-D (send EOF), gets returns nil
<jhass>
swistak35: so gets returns the union of String and Nil, String|Nil or String? for short
<jhass>
swistak35: puts has no issue printing nil, since Nil#to_s is a thing
<jhass>
however Nil#size is not
<swistak35>
well, but when I run the first program, it gives me a prompt, and I can type a word there
<jhass>
so you need to check whether you got nil: puts foo.try(:size) || "Got EOF!"
<jhass>
er, .try(&.size) it is
<swistak35>
and the word is passed correctly to foo variable, and then displayed -- so definitely `foo` is not nil in the first example
<jhass>
swistak35: at compile time we don't know that
<jhass>
crystal eval writes the argument to a temporary file, compiles it and then runs the resulting executable
<swistak35>
oh, ok, now I get it
<swistak35>
I thought it's runtime error already :)
<swistak35>
thank you
<swistak35>
+1 jhass
ismaelga has joined #crystal-lang
fowlduck has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 272 seconds]
ismaelga has quit [Remote host closed the connection]
uberTaco has joined #crystal-lang
uberTaco has quit [Client Quit]
sidoaight has joined #crystal-lang
uberTaco has joined #crystal-lang
<uberTaco>
hola
<uberTaco>
just starting to poke around with Crystal on an OSX Yosemite machine, via homebrew
<uberTaco>
when running crystal run hello-world.cr (which just contains puts "hello world")
<uberTaco>
I get clang errors about linker commands failing
<uberTaco>
specifically "ld: library not found for -levent"
<uberTaco>
derp, found a github issue. So sorry to bother you all
barosl has quit [Ping timeout: 272 seconds]
shama has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 255 seconds]
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vBmd5
<crystal-gh>
crystal/master d4a58a0 Ary Borenszweig: MemoryIO can now be created to read/write from a Slice(UInt8). In this mode MemoryIO can't be exapnded, and can optionally be written. And when creating a MemoryIO from a String, it's non-resizeable and read-only. Fixes #1775
swistak35 has quit [Quit: leaving]
shama has joined #crystal-lang
sidoaight has left #crystal-lang ["We need to work as a team. Which means doing what I say."]
<travis-ci>
manastech/crystal#d4a58a0 (master - MemoryIO can now be created to read/write from a Slice(UInt8). In this mode MemoryIO can't be exapnded, and can optionally be written. And when creating a MemoryIO from a String, it's non-resizeable and read-only. Fixes #1775): The build has errored. https://travis-ci.org/manastech/crystal/builds/92858028