jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.7.6 | 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
<dzv> looks like a lot of work. there must be an easier way
<dzv> or should be
<sfcgeorge> I think should be ;) Hopefully someone more knowledgeable will pop up with some insight
waj has quit [Ping timeout: 252 seconds]
sfcgeorge has quit [Quit: Textual IRC Client: www.textualapp.com]
kyrylo has quit [Quit: Konversation terminated!]
kyrylo has joined #crystal-lang
waj has joined #crystal-lang
kyrylo has quit [Ping timeout: 240 seconds]
zamith has quit [Quit: Be back later ...]
havenwood has joined #crystal-lang
leafybasil has joined #crystal-lang
havenwood has quit [Ping timeout: 252 seconds]
sardaukar has quit [Ping timeout: 256 seconds]
sardaukar has joined #crystal-lang
kulelu88 has quit [Quit: Leaving]
blue_deref has quit [Quit: bbn]
waj has quit [Remote host closed the connection]
<dzv> why does "yield a, b" work everywhere else?
<dzv> actually that doesn't work
<dzv> k={1, "foo"}, v=nil inside of each
havenwood has joined #crystal-lang
havenwood has quit [Ping timeout: 255 seconds]
waj has joined #crystal-lang
<crystal-gh> [crystal] waj pushed 2 new commits to master: http://git.io/v3AJS
<crystal-gh> crystal/master cce46ff Juan Wajnerman: Refactored libevent wrappers and Scheduler
<crystal-gh> crystal/master 1e23667 Juan Wajnerman: Fixed memory leak with `sleep`
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<travis-ci> manastech/crystal#1e23667 (master - Fixed memory leak with `sleep`): The build was broken. https://travis-ci.org/manastech/crystal/builds/75883319
sailorswift has joined #crystal-lang
waj has joined #crystal-lang
waj has quit [Ping timeout: 250 seconds]
ssvb has joined #crystal-lang
sailorswift has quit [Quit: Textual IRC Client: www.textualapp.com]
havenwood has joined #crystal-lang
BlaXpirit has joined #crystal-lang
NeverDie has joined #crystal-lang
NeverDie_ has joined #crystal-lang
NeverDie_ has quit [Max SendQ exceeded]
NeverDie_ has joined #crystal-lang
NeverDie has quit [Ping timeout: 256 seconds]
sailorswift has joined #crystal-lang
NeverDie_ has quit [Read error: Connection reset by peer]
<crystal-gh> [crystal] bjmllr opened pull request #1207: add MatchData#pre_match and #post_match and document MatchData (master...prematch) http://git.io/v3A4N
waj has joined #crystal-lang
waj has quit [Ping timeout: 246 seconds]
strcmp1 has joined #crystal-lang
strcmp1 has quit [Client Quit]
elia has joined #crystal-lang
blue_deref has joined #crystal-lang
zamith has joined #crystal-lang
leafybasil has quit [Read error: Connection reset by peer]
leafybasil has joined #crystal-lang
blue_deref has quit [Quit: bbn]
waj has joined #crystal-lang
waj has quit [Ping timeout: 264 seconds]
kyrylo has joined #crystal-lang
trapped has joined #crystal-lang
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
dbackeus has joined #crystal-lang
dbackeus has quit [Remote host closed the connection]
dbackeus has joined #crystal-lang
strcmp1 has joined #crystal-lang
dbackeus has quit [Ping timeout: 246 seconds]
waj has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
waj has quit [Ping timeout: 255 seconds]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
strcmp1 has quit [Quit: Leaving]
dbackeus has joined #crystal-lang
<dbackeus> getting a *args casting error after upgrading to Crystal 0.7.6, the following compiles fine in 0.7.5: http://play.crystal-lang.org/#/r/bpk
<dbackeus> I guess it's a bug and not by design?
<BlaXpirit> dbackeus, :o looks like a bug to me
<BlaXpirit> also looks like you're doing something unidiomatic
<BlaXpirit> and there is a better alternative
<dbackeus> what would you suggest?
<jhass> I'd say the 0.7.5 behavior is a bug
<jhass> mmh, or maybe it should be able to resolve the union
<jhass> idk
<dbackeus> BlaXpirit: do you mean that your suggestion is better/more idiomatic or just a way to get around the compiler error?
<dbackeus> I found it a bit harder to follow to be honest :)
<BlaXpirit> dbackeus, why are you passing this hash like that?
<BlaXpirit> shouldn't it be just some keyword arguments
<BlaXpirit> or hmmm maybe crystal doesn't support them like this
<BlaXpirit> i dont know
<BlaXpirit> i found a horrible bug tho
<dbackeus> I'm using them for url helpers in a web framework I'm playing with: https://github.com/startram/startram/blob/master/src/startram/route.cr#L10
<dbackeus> the hash builds a query string if passed
<BlaXpirit> http://carc.in/#/r/bps what's this called? buffer overflow?
<jhass> oO
<jhass> that hurts
Ven has joined #crystal-lang
ssvb has quit [Ping timeout: 252 seconds]
sleeper_ is now known as sleeper
<BlaXpirit> ok now this i just can't understand http://carc.in/#/r/bpw
<BlaXpirit> this also works just fine on my computer
<jhass> luck, the resizing seems broken when you specify an initial capacity http://carc.in/#/r/bpy
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass> definitely a bug
<BlaXpirit> jhass, yeah, it's Array.new(value, size) that's broken
<BlaXpirit> i reported on github
<BlaXpirit> i didn't run into this problem by accident
<BlaXpirit> i studied the code when writing deque imp[lementation
waj has joined #crystal-lang
Ven has joined #crystal-lang
waj has quit [Ping timeout: 244 seconds]
Netfeed has quit [Quit: WeeChat 0.3.0]
Netfeed has joined #crystal-lang
zamith has quit [Quit: Be back later ...]
Netfeed has quit [Quit: WeeChat 0.4.2]
Netfeed has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zipR4ND has joined #crystal-lang
zipR4ND has quit [Ping timeout: 265 seconds]
ssvb has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
sardaukar has quit [Ping timeout: 256 seconds]
Raimondi has quit [Quit: The road to wisdom?—Well, it's plain and simple to express: Err and err and err again, but less and less and less. — Piet Hein]
sardaukar has joined #crystal-lang
strcmp1 has joined #crystal-lang
waj has joined #crystal-lang
kostya has joined #crystal-lang
waj has quit [Ping timeout: 252 seconds]
dbackeus has quit []
oal has quit [Ping timeout: 245 seconds]
sailorswift has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven has quit [Client Quit]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
flou has joined #crystal-lang
daphee has joined #crystal-lang
havenwood has joined #crystal-lang
<daphee> Hi, I expect this: http://carc.in/#/r/br7 to print "test, false, true" and find the output "test, true, false" quite unintuitive. What is going on there?
<BlaXpirit> daphee, u must test a:"test", c:"true"
<jhass> daphee: http://carc.in/#/r/br8 no keyword arguments for required parameters yet, a="foo" is just an assignment
<BlaXpirit> because... yeah^
<BlaXpirit> wait, jhass, so now why doesn't that work?
Ven has joined #crystal-lang
<jhass> because we don't have keyword arguments for required parameters yet
<BlaXpirit> riiight...
<daphee> Ah so what I actually wanted to do was this: http://carc.in/#/r/brb
<daphee> I just have to use ":" instead of "=" then. Thanks
<BlaXpirit> that works, daphee,
<daphee> yeah, cool
<BlaXpirit> a few years ago i was like "pascal is such a savage language using := for assignment"
<BlaXpirit> but using = for assignment is just the worst, especially if you allow it as an expression
flou has quit [Quit: Textual IRC Client: www.textualapp.com]
<jhass> I think if we just disallow assignment in calls it's okay
Raimondi has joined #crystal-lang
waj has joined #crystal-lang
waj has quit [Ping timeout: 244 seconds]
daphee has quit [Quit: Leaving.]
kyrylo has quit [Ping timeout: 272 seconds]
ylluminate has quit [Ping timeout: 245 seconds]
ylluminate has joined #crystal-lang
blue_deref has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
Raimondii has joined #crystal-lang
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
P_raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 246 seconds]
Raimondii has quit [Ping timeout: 260 seconds]
Raimondi has joined #crystal-lang
P_raimondii has quit [Ping timeout: 250 seconds]
DeBot has quit [Quit: Crystal IRC]
DeBot has joined #crystal-lang
Sadin has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Sadin has quit [Quit: leaving]
kostya has quit [Remote host closed the connection]
shama has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 246 seconds]
zamith has joined #crystal-lang
Raimondii is now known as Raimondi
<crystal-gh> [crystal] PragTob opened pull request #1212: Sort enumerable methods (+ new specs) (master...sort-enumerable-methods) http://git.io/v3jK5
<BlaXpirit> what, is there no opposite to succ ???
<BlaXpirit> but I want Range.reverse_each :(
<jhass> in Ruby it's pred
<BlaXpirit> why doesnt crystal have it?
<jhass> because nobody implemented it?
<jhass> you should be used to that answer by now :P
<BlaXpirit> i mean... if someone was implementing succ, why not make pred
<jhass> because the usecases for it are lot rarer and nobody thought of it
<BlaXpirit> oh i think there are only 3 succ methods total
<BlaXpirit> should be easy to make pred
<BlaXpirit> and then i also implement Range.reverse_each
<BlaXpirit> well i actually implemented it already
zamith has quit [Quit: Be back later ...]
havenwood has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 250 seconds]
Raimondii is now known as Raimondi
<BlaXpirit> hm, can't build Crystal on Ubuntu. undefined reference to `LLVMInitializeInstrumentation' and a ton of other "undefined reference to `LLVM...'"
<BlaXpirit> LLVM is installed
<BlaXpirit> crystal from repository is instaled
<BlaXpirit> this is Ubuntu 14.04
<jhass> BlaXpirit: which version of LLVM?
<BlaXpirit> i dont even know
<jhass> llvm-config -v or something iirc
<BlaXpirit> jhass, 3.4
<jhass> that's too old, we'll need 3.5 or later
<BlaXpirit> jhass, good news, there is a package "llvm-3.5" :D
<BlaXpirit> oh 3.6 even
zamith has joined #crystal-lang
<BlaXpirit> bad news is that doesnt help
<BlaXpirit> because "llvm" is still 3.4
<jhass> update-alternatives stuff?
blue_deref has quit [Quit: bbn]
zipR4ND has joined #crystal-lang
<BlaXpirit> thanks. this monstrosity helped https://gist.github.com/jc00ke/b55cf7d16d584fbb2b92
<BlaXpirit> (of course, first i did this http://kwangyulseo.com/2014/02/05/using-multiple-llvm-versions-on-ubuntu/ then had to look how to remove it so the other one doesn't fail)
<BlaXpirit> and then this https://bpaste.net/show/d7e703525a64
<BlaXpirit> obviously old version of some other lib now
<jhass> that seems missing or old libpcl, yeah
<jhass> also bdw gc
<BlaXpirit> looks like it's virtual machine time
<jhass> in theory you could use the stuff from the official package for that ones
<jhass> LD_LIBRARY_PATH="/opt/crystal/embedded/something"
<BlaXpirit> oooh
<BlaXpirit> lol, that works like a charm even for `make`
<BlaXpirit> not for `make spec` though
<BlaXpirit> env LD_LIBRARY_PATH=/opt/crystal/embedded/lib/ LIBRARY_PATH=/opt/crystal/embedded/lib/ make spec this seems to be taking a long time without failing
<BlaXpirit> maybe it will be successful
<BlaXpirit> so it gave an error so huge that i had to output to a file to see it /usr/bin/ld: cannot find -lyaml
<jhass> time to get libyaml! :P
<jhass> ?libraries
<DeBot> jhass: Nothing known about libraries.
<jhass> mmh
<BlaXpirit> yeah, it was fun hunting these libs one by one
<jhass> ?libraries=You can find a list of all libraries required to compile the compiler and run the test suite at https://github.com/manastech/crystal/wiki/All-required-libraries
<DeBot> jhass: Set libraries.
<BlaXpirit> esp. now that it takes >1 minute before spewing an error
<BlaXpirit> working!
<BlaXpirit> thanks a lot
<BlaXpirit> wait, does that mean libyaml should be added in the wiki?
<jhass> uh, yeah
<jhass> feel free to
<jhass> I guess it was already installed in Ary's VM :P
<BlaXpirit> ok
<cina> does the splat operator exist in Crystal, e.g.:
<cina> >> case 1; when *[1,2]; true; when 3; false; end
<DeBot> cina: Syntax error in eval:4: unexpected token: * - http://carc.in/#/r/brt
<jhass> not for arrays, not as universally as in Ruby
<jhass> but for tuples you can do some stuff
<jhass> >> def foo(a, b); p a, b; end; c = {1, 2}; foo(*c)
<DeBot> jhass: in line 4: wrong number of arguments for 'p' (2 for 1) - http://carc.in/#/r/bru
<cina> why not?
<jhass> meh
<jhass> >> def foo(a, b); p({a, b); end; c = {1, 2}; foo(*c)
<DeBot> jhass: Syntax error in eval:4: unterminated tuple literal - http://carc.in/#/r/brv
<jhass> sigh
<jhass> >> def foo(a, b); p({a, b}); end; c = {1, 2}; foo(*c)
<DeBot> jhass: {1, 2} - more at http://carc.in/#/r/brw
<jhass> cina: the compiler would need to track all possible values in the arrays with distinct types per position in the array to generate the right call
<jhass> keep in mind that your code isn't interpreted as it's run like in Ruby
<cina> what if all the elements are of the same type? e.g. arr = [] of String
<jhass> the compiler still would need to track the size
<jhass> which might not even be constant at a given point in the code
<cina> I see
<jhass> because things are inserted on conditions only available at runtime
<cina> thanks for the explanation!
<jhass> yw
<jhass> so it works for tuples because they're limited in ways that makes all that possible for the compiler, known and constant size and known types per position
<crystal-gh> [crystal] BlaXpirit opened pull request #1215: Add `pred` operation (opposite to `succ`) (master...pred) http://git.io/vselS
<BlaXpirit> now I doubt if Range.reverse_each is something desirable, because Ruby doesn't have it\
<jhass> no it makes sense for Crystal
<jhass> Ruby took ages to even get reverse_each :P
<jhass> for Array
<BlaXpirit> jhass, how does it work if i base a new pull request on this branch which hasn't been merged?
kulelu88 has joined #crystal-lang
<BlaXpirit> i mean.. it would probably have those commits included as well, but what happens after they get merged
<jhass> BlaXpirit: if you make sure it stays the same commit (no rebase) GH should update as the former is merged
<BlaXpirit> nice
<jhass> (and if asterite doesn't cherry pick or something ;) )
<jhass> but if that doesn't happen just rebase them out then (update your master, git rebase -i your second branch onto it, throwing the duplicates out)
elia has joined #crystal-lang
Netfeed has quit [Quit: WeeChat 1.0.1]
elia has quit [Quit: Computer has gone to sleep.]
kyrylo has joined #crystal-lang
elia has joined #crystal-lang
Netfeed has joined #crystal-lang
Netfeed is now known as Netfeed
Netfeed has quit [Quit: WeeChat 1.0.1]
Netfeed has joined #crystal-lang
<crystal-gh> [crystal] BlaXpirit opened pull request #1217: Add Range#reverse_each (master...range-reverse-each) http://git.io/vseoN
Netfeed has quit [Quit: WeeChat 1.0.1]
Netfeed has joined #crystal-lang
kulelu88 has quit [Ping timeout: 260 seconds]
BlaXpirit has quit [Quit: Konversation]
kulelu88 has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #crystal-lang
elia has quit [Client Quit]
NeverDie has joined #crystal-lang
zipR4ND has quit [Ping timeout: 255 seconds]
waj has joined #crystal-lang
waj has quit [Remote host closed the connection]
waj has joined #crystal-lang
zamith has quit [Quit: Be back later ...]
nahtnam has left #crystal-lang [#crystal-lang]
pleiosaur has quit [Ping timeout: 250 seconds]
pleiosaur has joined #crystal-lang