asterite changed the topic of #crystal-lang to: #crystal-lang The Crystal programming language | http://crystal-lang.org | Crystal 0.6.1 | 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
ponga has joined #crystal-lang
ponga has quit [Ping timeout: 248 seconds]
bcardiff has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
strcmp1 has quit [Ping timeout: 264 seconds]
shama has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
ryanf_ is now known as ryanf
shama has quit [Remote host closed the connection]
shama has joined #crystal-lang
shama_ has joined #crystal-lang
shama has quit [Ping timeout: 265 seconds]
zipR4ND has joined #crystal-lang
chc4 has joined #crystal-lang
shama_ is now known as shama
strcmp1 has joined #crystal-lang
zipR4ND has quit [Ping timeout: 256 seconds]
ponga has joined #crystal-lang
ponga has quit [Ping timeout: 264 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vfXtg
<crystal-gh> crystal/master 1dcabc4 Ary Borenszweig: Fixed #576: when a class was inherited, only the direct superclass was being notified (missing recursive call)
<travis-ci> manastech/crystal#2260 (master - 1dcabc4 : Ary Borenszweig): The build passed.
shama has quit [Read error: Connection reset by peer]
shama has joined #crystal-lang
shama has quit [Read error: Connection reset by peer]
shama has joined #crystal-lang
shama has quit [Remote host closed the connection]
shama_ has joined #crystal-lang
strcmp1 has quit [Ping timeout: 256 seconds]
romanoff has joined #crystal-lang
romanoff has quit [Client Quit]
vikaton has quit [Quit: Connection closed for inactivity]
shama_ has quit [Remote host closed the connection]
Kache4 has joined #crystal-lang
Kache4 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
chc4 has quit [Quit: AHHHHH BEES]
shama has joined #crystal-lang
shama has quit [Ping timeout: 276 seconds]
Kache4 has joined #crystal-lang
Kache4 has quit [Client Quit]
DerisiveLogic has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
strcmp1 has joined #crystal-lang
ponga has joined #crystal-lang
ponga has quit [Ping timeout: 250 seconds]
BlaXpirit has joined #crystal-lang
ponga has joined #crystal-lang
dhruv has joined #crystal-lang
BlaXpirit has quit [Quit: Quit Konversation]
strcmp1 has quit [Ping timeout: 276 seconds]
Ven has joined #crystal-lang
colorisco has quit [Ping timeout: 250 seconds]
dhruv has quit [Ping timeout: 244 seconds]
BlaXpirit has joined #crystal-lang
<BlaXpirit> hidden integer division sucks
<BlaXpirit> took me more than an hour to debug because i didn't expect it
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven has quit [Max SendQ exceeded]
DerisiveLogic has quit [Ping timeout: 250 seconds]
Ven has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
ponga has quit [Remote host closed the connection]
BlaXpirit_ has joined #crystal-lang
BlaXpirit has quit [Ping timeout: 240 seconds]
DerisiveLogic has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
ponga has joined #crystal-lang
zipR4ND has joined #crystal-lang
Ven has quit [Read error: No route to host]
ponga has quit [Remote host closed the connection]
ponga has joined #crystal-lang
zipR4ND has quit [Ping timeout: 250 seconds]
Ven has joined #crystal-lang
vikaton has joined #crystal-lang
JBat has joined #crystal-lang
wanderer_ has joined #crystal-lang
wanderer_ has quit [Ping timeout: 246 seconds]
HakanD has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 256 seconds]
HakanD_ has joined #crystal-lang
HakanD has quit [Ping timeout: 248 seconds]
jhass has quit [Quit: Bye]
jhass has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
havenwood has joined #crystal-lang
HakanD_ has quit [Quit: Be back later ...]
HakanD_ has joined #crystal-lang
<vikaton> I wonder where asterite si
wanderer_ has joined #crystal-lang
wanderer_ has quit [Client Quit]
wanderer_ has joined #crystal-lang
wanderer_ has quit [Ping timeout: 246 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
HakanD_ has quit [Quit: Be back later ...]
HakanD_ has joined #crystal-lang
Dreamer3_ has joined #crystal-lang
<Dreamer3_> where can i find documentation on {%
<jhass> I don't think there's any yet
<jhass> are you talking about macros or ecr?
<Dreamer3_> no idea looks like pre-processor directives for generating code that you could do at runtime in ruby since it's truly dynamic
<Dreamer3_> {% for method in %w(get post put delete patch) %}
<jhass> that's macro code, yeah
<jhass> do you have any question about it?
HakanD_ has quit [Ping timeout: 264 seconds]
strcmp1 has joined #crystal-lang
yawniek has quit [Remote host closed the connection]
HakanD_ has joined #crystal-lang
havenn has joined #crystal-lang
havenwood has quit [Ping timeout: 272 seconds]
havenn has quit [Ping timeout: 252 seconds]
havenwood has joined #crystal-lang
DerisiveLogic has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 245 seconds]
DerisiveLogic has joined #crystal-lang
JBat has quit [Quit: Computer has gone to sleep.]
dhruv has joined #crystal-lang
shama has joined #crystal-lang
<Dreamer3_> what language is it? crystal inside crystal?
<jhass> no, the macro language is something on its own
<jhass> more like a templating language
<jhass> to generate code
<Dreamer3_> i see
<Dreamer3_> i could have sworn i saw docs on blocks somewhere so you could change self inside the block
<Dreamer3_> where was that?
<jhass> not sure, but you can change the context of a block with the with context yield statement
<Dreamer3_> example?
<Dreamer3_> found it
<Dreamer3_> but that's only with default block
<Dreamer3_> is there a way to do it with a specific block?
<jhass> not that I'm aware of
<Dreamer3_> no instance_eval i assume?
<jhass> but you can easily write a helper that does it: def run_with_scope(scope); with scope yield; end; run_with_scope &some_proc
<jhass> no, no instance_eval
<Dreamer3_> ah, good point :)
<jhass> with x yield is the sort of replacement for it
<Dreamer3_> no crystal syntax for TM or Sublime yet?
<jhass> asterite still didn't add it to packagecontrol :/
<Dreamer3_> so blocks can't be optional method arguments?
<BlaXpirit_> jhass, i finally got around to utilizing your code for classmethod constructors. works nicely, thanks.
<BlaXpirit_> what's the license on it? :p
<jhass> BlaXpirit_: consider stuff I post to IRC public domain ;D
HakanD_ has quit [Quit: Be back later ...]
<BlaXpirit_> cool
<jhass> Dreamer3_: no, but it counts into the method signature, so you can add an overload that doesn't take a block
<Dreamer3_> ah i see
<Dreamer3_> forget about that :)
<Dreamer3_> does yield not work inside initializers
<jhass> it should
<Dreamer3_> does yield not work inside initializers
<Dreamer3_> sorry
<Dreamer3_> but is `self.yield` not expected to work?
<Dreamer3_> i want to yield with the new class as the scope
<jhass> no, that syntax is obsolete, it's with self yield now
<Dreamer3_> "self yield"?
<jhass> >> class Foo; property bar; def initialize; with self yield; end; end; Foo.new { self.bar = 1 }.bar
<DeBot> jhass: in line 3: there's no self in this scope
<jhass> meh
<jhass> >> class Foo; property bar; def initialize; @bar = 1; with self yield; end; end; Foo.new { p bar }
<DeBot> jhass: in line 3: undefined local variable or method 'bar'
<jhass> well, looks that doesn't work yet :/
<jhass> weird, I thought I did that already
<BlaXpirit_> i never remembered this
<BlaXpirit_> how to deal with nillable type?
<BlaXpirit_> a function may return nil, but i know it won't be
<BlaXpirit_> how do i use the return value?
<Dreamer3_> i don't hit that error but i get undefined method 'get' when it should work if the scope was right
<jhass> BlaXpirit_: .try or .not_nil!
<Dreamer3_> jhass: so the problem i using it inside init?
<jhass> apparently
<BlaXpirit_> thx
<BlaXpirit_> hm, no opengl bindings
<jhass> https://github.com/ggiraldez/crystal-gl not idea if that's anywhere usable
<vikaton> >> 0x0539 + 1
<DeBot> vikaton: 1338
<BlaXpirit_> has very few functions
<BlaXpirit_> maybe it's like bindings only for modern opengl
<BlaXpirit_> or an arbitrary subset, whatever
<BlaXpirit_> i want glVertex2f :D
<BlaXpirit_> nothing important, just to port a simple sfml example
<jhass> I guess just quickly bind it by hand :P
<BlaXpirit_> yeah, that's what i just thought
<Dreamer3_> grrr
<Dreamer3_> even trying to save the block to an instance variable seems to want to "run" it and throws an error
<Dreamer3_> before i can even try to run it later
<jhass> huh?
<Dreamer3_> @block = block
<Dreamer3_> blows up with the same error, without me even trying to run the block
<jhass> >> class Foo; getter code; def initialize(&@code); end; end; Foo.new { p "hey" }
<DeBot> jhass: #<Foo:0x98BBFF0 @code=#<( -> Void):0x8049E00>>
<jhass> >> class Foo; getter code; def initialize(&@code); end; end; Foo.new { p "hey" }.code.call
<DeBot> jhass: in /usr/lib/crystal/io.cr:339: undefined method 'inspect' for Void
<jhass> oh, right
<jhass> >> class Foo; getter code; def initialize(&@code); end; end; Foo.new { p "hey" }.code.call; 1
<DeBot> jhass: "hey"
<Dreamer3_> must i set a getter?
<jhass> no
<Dreamer3_> if i'm only going to use it internally?
<jhass> >> class Foo; def initialize(&code); @code = code; end; def invoke; @code.call; end; Foo.new { p "hey" }
<DeBot> jhass: Syntax error in eval:7: expecting identifier 'end', not 'EOF'
<jhass> >> class Foo; def initialize(&code); @code = code; end; def invoke; @code.call; end; end; Foo.new { p "hey" }
<DeBot> jhass: #<Foo:0x9A0AFF0 @code=#<( -> Void):0x8049E00>>
<jhass> >> class Foo; def initialize(&code); @code = code; end; def invoke; @code.call; end; end; Foo.new { p "hey" }.invoke
<DeBot> jhass: in /usr/lib/crystal/io.cr:339: undefined method 'inspect' for Void
<jhass> >> class Foo; def initialize(&code); @code = code; end; def invoke; @code.call; end; end; Foo.new { p "hey" }.invoke; 1
<DeBot> jhass: "hey"
<jhass> seems to work :)
<Dreamer3_> define a method on your class and try to call it from inside the block
<jhass> well yeah, the context changing is still a bit wonky I guess
<Dreamer3_> >> 1 + 1
<DeBot> Dreamer3_: 2
<jhass> especially for a captured block
<Dreamer3_> class Foo; def get; end; def initialize(&code); @code = code; end; def invoke; @code.call; end; end; Foo.new { get() }.invoke; 1
<jhass> so for now the saner choice might to just yield self
<Dreamer3_> class Foo; def get(); end; def initialize(&code); @code = code; end; def invoke; @code.call; end; end; Foo.new { get() }.invoke; 1
<Dreamer3_> ?
<jhass> prefix with >>
<Dreamer3_> >> class Foo; def get(); end; def initialize(&code); @code = code; end; def invoke; @code.call; end; end; Foo.new { get() }.invoke; 1
<DeBot> Dreamer3_: Error in line 3: undefined method 'get' (did you mean 'gets'?)
<Dreamer3_> yield self how?
<Dreamer3_> this is all because yielding self didn't seem to work :)
<jhass> >> class Foo; def get; end; def initialize(&code); @code = code; end; def invoke; @code.call(self); end; end; Foo.new {|x| x.get }.invoke; 1
<DeBot> jhass: Error in line 3: wrong number of block arguments (1 for 0)
<jhass> >> class Foo; def get; end; def initialize(&code : self ->); @code = code; end; def invoke; @code.call(self); end; end; Foo.new {|x| x.get }.invoke; 1
<DeBot> jhass: Error in line 3: undefined method 'get' for Foo:Class
<jhass> >> class Foo; def get; end; def initialize(&code : Foo ->); @code = code; end; def invoke; @code.call(self); end; end; Foo.new {|x| x.get }.invoke; 1
<DeBot> jhass: 1
<Dreamer3_> yeah i did'nt want to have to pass it to itself
<Dreamer3_> that stopped being cool in Ruby like 5 years ago :)
<jhass> >> class Foo; def get; end; def initialize(&code); @code = code; end; def run_with_self; with self yield; end; def invoke; run_with_self &@code; end; end; Foo.new { get }.invoke; 1
<DeBot> jhass: Error in line 3: undefined local variable or method 'get' (did you mean 'gets'?)
<jhass> worth a try
<jhass> it just doesn't work well for captured blocks yet (or not at all)
<jhass> since tracking what the proc might be invoked with is very hard that way
<jhass> keep in mind the compiler needs to analyze that to type it correctly
<Dreamer3_> trying to figure out what the diff is... Moonshine's code seems to let it save blocks for later
<Dreamer3_> telling it the block in/out types doens't seem to help any
<Dreamer3_> telling it the block in/out types doens't seem to help any
DerisiveLogic has quit [Ping timeout: 244 seconds]
dhruv has quit [Ping timeout: 248 seconds]
<BlaXpirit_> >> fail ":("
<DeBot> BlaXpirit_: Error in line 3: undefined method 'fail'
<vikaton> >> raise "?"
<DeBot> vikaton: Exception: ?
<BlaXpirit_> uh thanks
<Dreamer3_> ha
<Dreamer3_> and now i hit a real bug in the compiler
<Dreamer3_> and now i hit a real bug in the compiler
<jhass> happens
<jhass> you test with crystal head though?
<Dreamer3_> no, installing via homebrew, how old is that?
<Dreamer3_> Crystal 0.6.1 [48461ba] (Wed Mar 4 22:59:12 UTC 2015)
<Dreamer3_> kinda of ol
<jhass> head as tons of fixes, yeah
<jhass> try git clone https://github.com/manastech/crystal.git; cd crystal; make
<jhass> and if that worked out /path/to/crystal/bin/crystal to invoke it
<ponga> jhass: im on 0.6.0 is 0.6.1 update worth it
<jhass> you ask an archlinux user if updating something is worth it? :P
<strcmp1> has arch linux reinstated the installer yet
<ponga> jhass: i installed it thru homebrew, can i update it with homebrew?
<jhass> strcmp1: no, but there's antergos which is basically a graphical installer for arch
<jhass> ponga: I'd expect so
<ponga> it gives warning its already installed
<ponga> uninstall crystal then install again?
<jhass> I have no clue about the os x stuff
<ponga> ok
<ponga> uh oh
<ponga> jhass: brew install fetches 0.6.0
<ponga> reporting
<jhass> you probably need to update some index or so?
<BlaXpirit_> https://github.com/ggiraldez/crystal-gl/tree/master/libs srsly sfml-window can replace most of this if u just want to do OpenGL
<BlaXpirit_> instead of wasting time on random kinda-related libs someone should just make good bindings for GL and perhaps GLU
<ponga> jhass: solved, thanks
<ponga> i often forget this
DerisiveLogic has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
ponga has quit [Quit: Leaving...]
<vikaton> No problem Blax xP
<vikaton> BlaXpirit_: Also, some of those are just PoCs
BlaXpirit_ has quit [Quit: Quit Konversation]
<Dreamer3_> ok lets try this again
<Dreamer3_> installing llvm 3.5.1
<Dreamer3_> 36 didn't seem to do the trick
<Dreamer3_> SLOW
leafybasil has joined #crystal-lang
<Dreamer3_> i have no idea how you'd compile crystal if your compiler got too old
<jhass> if there are no prebuilt binaries, you'd advance from version to version
<Dreamer3_> yeah i guess
<Dreamer3_> with git tags i suppose that would be doable
<Dreamer3_> still building llvm, damn
<jhass> yeah, building llvm takes forever
<Dreamer3_> ld: library not found for -levent
<jhass> yeah, libevent is now required
<Dreamer3_> brew install libevent didn't seem to change antyhing
<Dreamer3_> any idea?
<Dreamer3_> building libevent from source vs bottle but dunno if that matters
<jhass> no, as said I never touched os x :/
strcmp1 has quit [Ping timeout: 250 seconds]
<vikaton> Dreamer3_ I was in your shoes with my debian vps, I just gave up till next release
DerisiveLogic has quit [Ping timeout: 264 seconds]
<Dreamer3_> ok i just need to know how to pass the correct location of the event lib to make
<Dreamer3_> it doesn't like it in .brew