jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.7.7 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
fowlduck has quit [Remote host closed the connection]
<crystal-gh> [crystal] technorama opened pull request #1443: Slice add == and bytesize methods. (master...f/slice_compare) http://git.io/vZ02w
<crystal-gh> [crystal] will opened pull request #1444: add TypeCastError for runtime casting exceptions (master...casting-exception) http://git.io/vZ0au
elia has quit [Quit: Computer has gone to sleep.]
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dfockler has quit [Remote host closed the connection]
qard has joined #crystal-lang
<waj_> Debugging the compiler :) https://asciinema.org/a/5vqkj12rc60echbpbtslja66i
waj_ is now known as waj
waj has quit [Remote host closed the connection]
havenwood has joined #crystal-lang
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
sadin has joined #crystal-lang
Netfeed has quit [Ping timeout: 240 seconds]
waj has joined #crystal-lang
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ponga has quit [Quit: Connection closed for inactivity]
dylanmei has quit [Ping timeout: 256 seconds]
sadin has quit [Read error: Connection reset by peer]
lokulin has quit [Ping timeout: 246 seconds]
lokulin has joined #crystal-lang
waj has quit [Remote host closed the connection]
havenwood has joined #crystal-lang
NeverDie has quit [Quit: http://radiux.io/]
waj has joined #crystal-lang
waj has quit [Ping timeout: 250 seconds]
waj_ has joined #crystal-lang
waj_ has quit [Ping timeout: 246 seconds]
ylluminate has joined #crystal-lang
BlaXpirit has joined #crystal-lang
ssvb has quit [Ping timeout: 244 seconds]
ylluminate has quit [Quit: Leaving.]
Netfeed has joined #crystal-lang
havenwood has quit [Ping timeout: 252 seconds]
Ven has joined #crystal-lang
waj_ has joined #crystal-lang
ylluminate has joined #crystal-lang
waj_ has quit [Ping timeout: 244 seconds]
Ven has quit [Ping timeout: 240 seconds]
elia has joined #crystal-lang
ylluminate has quit [Quit: Leaving.]
BlaXpirit has quit [Quit: Konversation]
kyrylo has joined #crystal-lang
sardaukar has quit [Ping timeout: 256 seconds]
waj_ has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
waj_ has quit [Remote host closed the connection]
sardaukar has joined #crystal-lang
sardaukar has quit [Ping timeout: 256 seconds]
leafybasil has joined #crystal-lang
ylluminate has joined #crystal-lang
ylluminate has quit [Ping timeout: 244 seconds]
ylluminate has joined #crystal-lang
waj_ has joined #crystal-lang
sardaukar has joined #crystal-lang
ssvb has joined #crystal-lang
waj_ has quit [Ping timeout: 250 seconds]
sardaukar has quit [Ping timeout: 256 seconds]
sardaukar has joined #crystal-lang
sardaukar has quit [Ping timeout: 256 seconds]
sardaukar has joined #crystal-lang
<crystal-gh> [crystal] jhass pushed 2 new commits to master: http://git.io/vZuch
<crystal-gh> crystal/master 0f3ea04 Technorama Ltd: Slice add == and bytesize methods.
<crystal-gh> crystal/master 7e91ea7 Jonne Haß: Merge pull request #1443 from technorama/f/slice_compare...
<travis-ci> manastech/crystal#7e91ea7 (master - Merge pull request #1443 from technorama/f/slice_compare): The build passed. https://travis-ci.org/manastech/crystal/builds/79821673
ponga has joined #crystal-lang
Ven has joined #crystal-lang
sardaukar_ has joined #crystal-lang
sardaukar has quit [Read error: Connection reset by peer]
BlaXpirit has joined #crystal-lang
sardaukar_ has quit [Ping timeout: 256 seconds]
waj has joined #crystal-lang
waj has quit [Ping timeout: 268 seconds]
kyrylo has quit [Ping timeout: 246 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ylluminate has quit [Ping timeout: 260 seconds]
ssvb has quit [Ping timeout: 268 seconds]
<dzv> is there any way to inspect a method? specifically to see where it was defined?
waj has joined #crystal-lang
elia has quit [Quit: (IRC Client: textualapp.com)]
<dzv> why does this comparison true? http://carc.in/#/r/eu1
waj has quit [Ping timeout: 260 seconds]
<jhass> dzv: crystal tool implementations --cursor foo.cr:line:col foo.cr, see http://crystal-lang.org/2015/09/05/tools.html
<nakilon> dudes, I've subscribed to crystal issues on github, but was far from pc last days
<nakilon> I see no reason in having '?' sign here: https://github.com/manastech/crystal/pull/1397
<nakilon> [].min/max returns nil in Ruby
<nakilon> not min?/max?
<jhass> nakilon: yes, but that's a pain to work with in Crystal
<jhass> same reason we have [] raise and []? return nil
<nakilon> I don't get it (
<nakilon> where is the pain?
<jhass> dzv: https://github.com/manastech/crystal/blob/master/src/array.cr#L722-L728 implementation side effect I guess, doubt it's thought through. Not saying it's not behaving intentional though
<jhass> nakilon: empty_or_not.min + 1 -> undefined method + for nil (compile time type Int32?)
<nakilon> [1,2,3][100] always was nice thing for me in Ruby, opposite to Python for example
<nakilon> but how having 'empty_or_not.min? + 1' saves us?
<nakilon> would be the same
<jhass> we have both now
<jhass> i_am_sure_this_is_not_empty.min + 1 # ok, may raise if I was wrong
<jhass> (empty_or_not.min? || 0) + 1 # ok, compiler forced us to handle the empty case
<nakilon> so it's just a shortcut to kinda assert?
<jhass> kinda
<nakilon> would be nice thing to have -- a docs page "Common gotchas when moving to Crystal from Ruby"
<nakilon> with such things as this one
<nakilon> otherwise newcomers like me will not know what exactly they are doing ..D having '?' needed to mimic Ruby in those methods is unexpected
elia has joined #crystal-lang
<jhass> ?from_ruby=https://github.com/manastech/crystal/wiki/Crystal-for-Rubyists
<DeBot> jhass: Set from_ruby.
<nakilon> oh
<jhass> feel free to add any ;)
<dzv> is there a way to check if something is a noncontainer value? is_a?(Int|Bool|Float|Nil|...) and not_a?(Tuple|StaticArray|Slice|...)
<nakilon> in Ruby you do.responds_to(:each) for this
kyrylo has joined #crystal-lang
elia has quit [Read error: Connection reset by peer]
elia_ has joined #crystal-lang
wuehlmaus has quit [Quit: Lost terminal]
dylanmei has joined #crystal-lang
emancu has joined #crystal-lang
NeverDie has joined #crystal-lang
havenwood has joined #crystal-lang
benoist has joined #crystal-lang
benoist has quit [Client Quit]
ssvb has joined #crystal-lang
tomchapin has joined #crystal-lang
emancu has quit []
waj has joined #crystal-lang
waj has quit [Remote host closed the connection]
waj has joined #crystal-lang
caryanne has joined #crystal-lang
<BlaXpirit> >> Array(Int32).is_a? Enumerable
<DeBot> BlaXpirit: # => false - http://carc.in/#/r/ey6
<BlaXpirit> :|
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
dfockler has joined #crystal-lang
luislavena has joined #crystal-lang
<waj> >> Array(Int32).new.is_a? Enumerable
<DeBot> waj: # => true - http://carc.in/#/r/ey8
apt-get has joined #crystal-lang
<thor77> >> [1].contain 1
<DeBot> thor77: Error in line 4: undefined method 'contain' for Array(Int32) - http://carc.in/#/r/ey9
<thor77> >> [1].contains 1
<DeBot> thor77: Error in line 4: undefined method 'contains' for Array(Int32) - http://carc.in/#/r/eya
<thor77> uh
<thor77> whats the right method to check if an array contains an specific element?
<thor77> >> [1].includes 1
<DeBot> thor77: Error in line 4: undefined method 'includes' for Array(Int32) (did you mean 'includes?'?) - http://carc.in/#/r/eyb
<thor77> >> [1].includes? 1
<DeBot> thor77: # => true - http://carc.in/#/r/eyc
<thor77> \o/
* thor77 is writing to less crystal...
dylanmei has quit [Quit: ZZZzzz…]
<jhass> waj: will the new debug stuff work with 3.7 too?
dylanmei has joined #crystal-lang
dylanmei has quit [Quit: ZZZzzz…]
<waj> jhass: it probably need some changes because the DIBuilder api changed again
<jhass> did you actually test it against 3.6 btw?
<waj> yes, I'm using 3.6 in my machine
<waj> maybe we should change the omnibus to use 3.6 too
<waj> BRB
waj has quit [Remote host closed the connection]
ylluminate has joined #crystal-lang
waj has joined #crystal-lang
<jhass> waj: hrm, getting http://paste.mrzyx.de/puqzxcdo6 with -d
<waj> with 3.6?
<jhass> yeah
<waj> did you also specify --single-module ?
* nakilon is making his very first fix+improve pullrequest in Array
<jhass> ah, right that I forgot
<jhass> maybe we should imply the flag with -d for now?
<waj> mmm... no, I need to fix it :)
<willl> speaking of -d, I was thinking the other day that maybe all non-release builds should assume -d
<waj> yup, that's reasonable
<waj> also because it'll enable to get better backtraces with line numbers and everything
<willl> :)
dylanmei has joined #crystal-lang
<jhass> mmh, either I'm too dumb to use lldb or it's not working for me
<jhass> should having "debugger" in the code and then running it through lldb drop back into the prompt if it's reached?
tomchapin has quit [Read error: Connection reset by peer]
tomchapi_ has joined #crystal-lang
<asterite> willl: what's your opinion of go's cgo?
<nakilon> jhass, I'm editing Array specs, pls tell me: if this [1, 2, 3][4, 0] is supposed to raise an error, why this [1, 2, 3][3 .. 1] isn't?
<waj> jhass: yes... what's happening instead?
<jhass> waj: it just hangs
elia_ has quit [Quit: Computer has gone to sleep.]
<nakilon> maybe it was a typo and really had to be [1, 2, 3][3 .. 1] ?
<nakilon> i mean [1, 2, 3, 4, 5, 6][3 .. 1]
<jhass> nakilon: because (3..1).to_a == []
<jhass> waj: and if I hit Ctrl+C then it drops into pthread_cond_wait
<jhass> well, exits at
<waj> can you share some code?
dylanmei has quit [Read error: Connection reset by peer]
<nakilon> jhass, but $ crystal eval "p [1,2,3,4,5][2..-2]"
<nakilon> [3, 4]
<jhass> waj: I just did puts "hi"; debugger; puts "ho"; (on three lines)
<nakilon> and it is also .to_a = []
dylanmei has joined #crystal-lang
<nakilon> I suppose he point was to mimic Ruby but with raising on indexex exceeding -length...length
<nakilon> then [1, 2, 3][3 .. 1] would have to raise too
<jhass> well it returns [] in Ruby too
<nakilon> *the point
<nakilon> in RUby [1, 2, 3][4, 0] doesn't raise
<jhass> but returns nil
<nakilon> accodring to current specs, Crystal does
<jhass> and usually where Ruby returns nil we raise
<nakilon> then this is wrong and I'm gonna fix the behavior? https://github.com/manastech/crystal/blob/master/spec/std/array_spec.cr#L147
NeverDie has quit [Quit: http://radiux.io/]
<nakilon> oh wait
apt-get has quit [Ping timeout: 268 seconds]
<jhass> Ruby returns nil in that case, so we raise
<nakilon> wrong line number
<jhass> that matches Ruby's behavior
<nakilon> and shouldn't, right?
<jhass> well, so far it should I think
<jhass> as said I think the rule so far is where Ruby returns nil we raise, [] != nil
<nakilon> also I'll have to think why sometimes it's ArgumentError instead of IndexError
<jhass> that probably should be unified
<nakilon> oh, sry, misread you
shama has joined #crystal-lang
luislavena has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
<jhass> waj: http://paste.mrzyx.de/padlhh2zo dunno if you can make anything out of this
<nakilon> oh, ArgumentError is when we you count instead of range
<jhass> mmh, can make sense I guess ;)
qard has joined #crystal-lang
apt-get has quit [Ping timeout: 268 seconds]
apt-get has joined #crystal-lang
<nakilon> this blows my mind
<nakilon> $ ruby -e "p [1, 2, 3][5 .. 4]" => nil
<nakilon> $ ruby -e "p [1, 2, 3][3 .. 1]" => []
<nakilon> i guess the reaon is because of BOTH ends are out of range
<nakilon> weird, that it's so comlicated
NeverDie has joined #crystal-lang
<nakilon> not even just "out" but "out more than by one": $ ruby -e "p [1, 2, 3][4 .. 1]" => nil
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
<waj> jhass: did you try with gdb?
<jhass> mmh, no, not yet
<jhass> interesting, seems to work
luislavena has joined #crystal-lang
leafybasil has quit [Ping timeout: 246 seconds]
<nakilon> and only in the positive direction, so this is not exactly correct: https://github.com/manastech/crystal/blob/master/src/array.cr#L397
<jhass> waj: line numbers seem to go wrong sometimes though http://cloud.aeshna.de/u/mrzyx/screenshots/screenshot_20150911_192146.png
tomchapi_ has quit [Quit: Textual IRC Client: www.textualapp.com]
tomchapin has joined #crystal-lang
tomchapin has quit [Read error: No route to host]
ylluminate has quit [Quit: Leaving.]
<waj> yes, I need to ask asterite about that
tomchapin has joined #crystal-lang
tomchapin has quit [Read error: No route to host]
<jhass> I wonder why lldb hangs for me though
NeverDie_ has joined #crystal-lang
tomchapin has joined #crystal-lang
ylluminate has joined #crystal-lang
<waj> I just tested in Linux and it hangs as well
<waj> however... when you do Ctrl+C it stops but in a different thread
<waj> and the main thread seems to be stopped just where it should
NeverDie has quit [Ping timeout: 246 seconds]
ylluminate has quit [Quit: Leaving.]
leafybasil has joined #crystal-lang
elia has joined #crystal-lang
ylluminate has joined #crystal-lang
<jhass> but you can't resume it
<jhass> it still hangs
NeverDie_ is now known as Neverdie
<asterite> nakilon: [1, 2, 3][4 .. 1] also gives nil
<nakilon> this method and the next has the same arguments -- doesn't the second one override the first one?
<asterite> It gives nil if any of the ends are out of bounds
<nakilon> oh, I guess Crystal sees, that this method accepts block
<jhass> yup, taking a block or not counts into the method signature
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #crystal-lang
elia_ has joined #crystal-lang
elia has quit [Ping timeout: 246 seconds]
elia_ has quit [Client Quit]
ylluminate has quit [Quit: Leaving.]
konsolebox has joined #crystal-lang
ylluminate has joined #crystal-lang
<konsolebox> hi i'm new to Crystal. do && and || follow the same precedence as in Ruby? i.e. && is higher than ||.
<jhass> that's a good question I never checked
<jhass> >> true && false || true && false
<DeBot> jhass: # => false - http://carc.in/#/r/eyp
<jhass> wait, that doesn't prove anything
dfockler has quit [Remote host closed the connection]
<konsolebox> >> true || false && false
<DeBot> konsolebox: # => true - http://carc.in/#/r/eyq
<konsolebox> seems like it
<konsolebox> >> true or false and false
<DeBot> konsolebox: Syntax error in eval:4: unexpected token: or - http://carc.in/#/r/eyr
<konsolebox> too bad
<luislavena> jhass: I've published the library I was working (http routing) and compared against artanis as you wondered: https://github.com/luislavena/crystal-beryl/commit/e2b061d813433b7b6475191603408168a6adfe10
<konsolebox> we need that
<jhass> nope
<jhass> we don't :P
<konsolebox> s/we/i/
<konsolebox> because i hate the confusion when the logic chain gets long.. we rely too much on ()
<crystal-gh> [crystal] asterite pushed 3 new commits to master: http://git.io/vZ2Y1
<crystal-gh> crystal/master 7af12a8 Ary Borenszweig: Fixed Cast#to_s
<crystal-gh> crystal/master ee90784 Ary Borenszweig: Codegen: add missing `request_value` for Cast node. Related to #1444
<crystal-gh> crystal/master 430de21 Ary Borenszweig: Some fixes to wrong locations
<asterite> jhass: fixed the wrong location :)
<asterite> If you find more, let me know
<jhass> asterite: <3
<jhass> asterite: http://paste.mrzyx.de/p8mztjlgh shouldn't it point one line higher there?
<asterite> It's easier if you introduce a compile error at the line that has incorrect location, and the error message should point to an incorrect place
<asterite> Oh, but it's on the end
<jhass> yeah
<jhass> seems to be the pointerof location is one off, no?
<jhass> given it hits the def cstr correctly
<travis-ci> manastech/crystal#430de21 (master - Some fixes to wrong locations): The build has errored. https://travis-ci.org/manastech/crystal/builds/79902403
<asterite> Ah, I think pointerof doesn't have an instruction, I don't know. waj knows about this :)
<asterite> I think after a def you get to step on the "end", so maybe "pointerof" is being skipped
kyrylo has quit [Ping timeout: 240 seconds]
<jhass> mh
<jhass> let's see
<jhass> yeah okay, same for plain @var access I guess
<jhass> mmh, maybe not, now I landed twice on the same end
<jhass> dunno, something's odd there
<jhass> that second end should've been the 2423 io.write Slice.new(cstr, bytesize) from def to_s(io) again IMO
<jhass> or directly the initialize from Slice.new
<jhass> but it's getting usable, now variable introspection and it's actually useful :P
<BlaXpirit> https://github.com/BlaXpirit/crsfml-examples#slither - click the image for better quality, and try out the program for much better quality :p
dfockler has joined #crystal-lang
Neverdie has quit [Quit: http://radiux.io/]
pdurbin has left #crystal-lang ["WeeChat 0.4.3"]
Neverdie has joined #crystal-lang
fowlduck has joined #crystal-lang
tomchapin has quit [Quit: Textual IRC Client: www.textualapp.com]
tomchapin has joined #crystal-lang
<waj> jhass: quite delayed answer -> only assignments and calls have debug metadata right now, that's why many statements are skipped
Neverdie has quit [Quit: http://radiux.io/]
<jhass> still weird that I ended up on the same end twice in a row
qard_ has joined #crystal-lang
Neverdie has joined #crystal-lang
qard has quit [Read error: Connection reset by peer]
fowlduck has quit [Remote host closed the connection]
<BlaXpirit> srsly this is so cool http://gfycat.com/EachWaryAmazondolphin
<jhass> your globals look like constants
apt-get has quit [Ping timeout: 240 seconds]
<nakilon> how do I make a pull-request? fork, commit, push to master, create pull-request in web interface?
<nakilon> sry for noob question, never used Github
<BlaXpirit> nakilon, u just open a file u want to edit and edit it
<jhass> nakilon: basically, create a branch if you plan future/concurrent contributions
<BlaXpirit> i dont think it can be done if you want to change multiple files
Neverdie has quit [Quit: http://radiux.io/]
<nakilon> jhass, too late, pushed to master ) is it too bad?
<nakilon> I don't get, when the main repo commits are pulling into my fork?
<nakilon> fresh ones
<BlaXpirit> nakilon, uh never
<BlaXpirit> you need to maintain that
<jhass> it's fine, at the end of the day you can always create a new branch if needed from the upstream master
Neverdie has joined #crystal-lang
<BlaXpirit> how i do it: just clone main repo and add remote "fork"
fowlduck has joined #crystal-lang
<BlaXpirit> this ensures easy pulls to keep up to date
<jhass> if you want to move it: git branch -m master my_feature_branch; git push origin my_feature_branch; git remote add upstream https://github.com/manastech/crystal.git; git fetch upstream git checkout -b master upstream/master; git push -f origin master
<konsolebox> from my &&/|| vs. and/or comment earlier: anyway i just made an issue: https://github.com/manastech/crystal/issues/1449
Neverdie has quit [Client Quit]
apt-get has joined #crystal-lang
kyrylo has joined #crystal-lang
apt-get has quit [Client Quit]
apt-get has joined #crystal-lang
Neverdie has joined #crystal-lang
dfockler has quit [Remote host closed the connection]
havenwood has joined #crystal-lang
dfockler has joined #crystal-lang
<crystal-gh> [crystal] Nakilon opened pull request #1450: Fixed Array[](start : Int, count : Int) (master...fixed_slice) http://git.io/vZ2FK
<nakilon> damn git -- somehow commits got duplicated, lol
<nakilon> probably I can squash them
<jhass> nakilon: yeah, try git checkout fixed_slice; git rebase -i upstream/master;
<nakilon> fixed
BlaXpirit has quit [Quit: Konversation]
konsolebox has quit [Quit: Leaving]
Neverdie has quit [Quit: http://radiux.io/]
luislavena has quit []
kulelu88 has joined #crystal-lang
Neverdie has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
dylanmei has quit [Ping timeout: 265 seconds]
dylanmei has joined #crystal-lang
Neverdie has quit [Read error: Connection reset by peer]
Neverdie has joined #crystal-lang
leafybasil has joined #crystal-lang
apt-get has quit [Ping timeout: 252 seconds]
havenwood has quit [Ping timeout: 244 seconds]
Neverdie has quit [Quit: http://radiux.io/]
Neverdie has joined #crystal-lang
dylanmei has quit [Quit: ZZZzzz…]
waj has quit [Remote host closed the connection]
dfockler has quit [Remote host closed the connection]
waj has joined #crystal-lang
emmanueloga has quit [Ping timeout: 252 seconds]
grindhold has quit [Read error: Connection reset by peer]
[spoiler] has quit [Ping timeout: 252 seconds]
[spoiler] has joined #crystal-lang
grindhold has joined #crystal-lang
emmanueloga has joined #crystal-lang
waj has quit [Remote host closed the connection]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DJZ has joined #crystal-lang
Neverdie has quit [Quit: http://radiux.io/]
<DJZ> anyone here?\
<DJZ> really really dumb question
<DJZ> how do i compile on windows
Neverdie has joined #crystal-lang
<dzv> not possible currently
<DJZ> damn it
<DJZ> alright, thanks anyway
<dzv> there is a porting efforts on github somewhere
<DJZ> gonna probably set up a vm then