jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.7.3 | 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
kulelu88 has quit [Quit: Leaving]
jtarchie has quit [Quit: Connection closed for inactivity]
NeverDie has joined #crystal-lang
<crystal-gh> [crystal] will opened pull request #792: URI (master...uri) http://git.io/vIAlA
unshadow has quit [Ping timeout: 276 seconds]
Cidan is now known as zz_Cidan
BlaXpirit has quit [Quit: Quit Konversation]
datanoise has quit [Ping timeout: 244 seconds]
zz_Cidan is now known as Cidan
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
datanoise has joined #crystal-lang
bhishma has quit [Ping timeout: 255 seconds]
havenwood has quit [Ping timeout: 252 seconds]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
datanoise has quit [Ping timeout: 244 seconds]
havenwood has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
havenwood has quit [Ping timeout: 244 seconds]
havenwood has joined #crystal-lang
mdz_ has joined #crystal-lang
strcmp1 has joined #crystal-lang
Cidan is now known as zz_Cidan
havenwood has quit [Ping timeout: 276 seconds]
BlaXpirit has joined #crystal-lang
Dreamer3 has joined #crystal-lang
willl has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
Benoist has quit [Quit: Page closed]
mdz_ has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
mdz_ has joined #crystal-lang
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
datanoise has joined #crystal-lang
Ven has joined #crystal-lang
mdz_ has quit [Ping timeout: 264 seconds]
datanoise has quit [Ping timeout: 272 seconds]
bhishma has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
xd1le has joined #crystal-lang
<xd1le> How do I reference a capturing group in for example gsub?
<jhass> unlike ruby you get the MatchData yielded
<jhass> and I prefer that over using $~
<jhass> >> "foo".gsub(/f(o)o/) {|m| m[1].upcase }
<DeBot> jhass: # => "O" - http://carc.in/#/r/2zd
<xd1le> ooo that's nice
<xd1le> (both the solution and your bot)
tilpner has joined #crystal-lang
xd1le has quit [Ping timeout: 250 seconds]
xd1le has joined #crystal-lang
xd1le is now known as Guest74991
Guest74991 has quit [Client Quit]
datanoise has joined #crystal-lang
datanoise has quit [Ping timeout: 245 seconds]
unshadow has joined #crystal-lang
bhishma has quit [Remote host closed the connection]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
mdz_ has joined #crystal-lang
unshadow has quit [Ping timeout: 252 seconds]
mdz_ has quit [Ping timeout: 245 seconds]
havenwood has joined #crystal-lang
Ven is now known as Guest81620
Guest81620 is now known as Ven_
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven_ has joined #crystal-lang
asterite has joined #crystal-lang
<asterite> jhass: note that gsub yields the string and the match... maybe we should change that
mdz_ has joined #crystal-lang
<asterite> And also: I'm starting to dislike the magic $ variables :-/
<asterite> Gotta go now!
jhass has quit [Excess Flood]
jhass has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
unshadow has joined #crystal-lang
<unshadow> >> "foo" =~ /f(.*?)/i; puts $1
<DeBot> unshadow: # => 1 - more at http://carc.in/#/r/2zp
<unshadow> >> "foo" =~ /f(.*?)/i; puts $2
<DeBot> unshadow: IndexOutOfBounds: Index out of bounds - more at http://carc.in/#/r/2zq
asterite has quit [Ping timeout: 246 seconds]
unshadow has quit [Ping timeout: 252 seconds]
datanoise has joined #crystal-lang
mdz_ has joined #crystal-lang
unshadow has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
mdz_ has joined #crystal-lang
unshadow has quit [Ping timeout: 252 seconds]
icezimm has joined #crystal-lang
havenwood has quit [Ping timeout: 264 seconds]
NeverDie has joined #crystal-lang
willl has joined #crystal-lang
wmoxam has quit [Ping timeout: 246 seconds]
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
datanoise has quit [Ping timeout: 256 seconds]
mdz_ has quit [Remote host closed the connection]
wmoxam has joined #crystal-lang
mdz_ has joined #crystal-lang
datanoise has joined #crystal-lang
bogen has left #crystal-lang [#crystal-lang]
jeromegn has joined #crystal-lang
datanoise has quit [Ping timeout: 276 seconds]
mdz_ has quit [Remote host closed the connection]
mdz_ has joined #crystal-lang
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
mdz_ has quit [Ping timeout: 265 seconds]
<jeromegn> >> bool
<DeBot> jeromegn: Error in line 4: undefined local variable or method 'bool' - http://carc.in/#/r/2zx
<jeromegn> >> Bool
<DeBot> jeromegn: # => Bool - http://carc.in/#/r/2zy
<jeromegn> nice
<jeromegn> I’m rusty
datanoise has joined #crystal-lang
datanoise has quit [Ping timeout: 252 seconds]
mdz_ has joined #crystal-lang
<jbye> >> ["a", "b", "c"].map(&:capitalize)
<DeBot> jbye: Error in line 4: expected a function type, not Symbol - http://carc.in/#/r/30t
<jbye> :D
<jbye> >> ["a", "b", "c"].map(&.capitalize)
<DeBot> jbye: # => ["A", "B", "C"] - http://carc.in/#/r/30v
<jbye> cool
<jhass> >> %w(a b c d].map(&.ord.to_s(2))
<DeBot> jhass: Syntax error in eval:4: unexpected token: ) - http://carc.in/#/r/30w
<jhass> >> %w(a b c d).map(&.ord.to_s(2))
<DeBot> jhass: Error in line 4: undefined method 'ord' for String - http://carc.in/#/r/30x
<jhass> >> %w(a b c d).map(&.chars.first.ord.to_s(2))
<DeBot> jhass: # => ["1100001", "1100010", "1100011", "1100100"] - http://carc.in/#/r/30y
mdz_ has quit [Remote host closed the connection]
mdz_ has joined #crystal-lang
bcardiff has joined #crystal-lang
zipR4ND has joined #crystal-lang
zipR4ND has quit [Ping timeout: 272 seconds]
<jeromegn> anybody knows how to do C inheritance in a lib binding? Basically, how would I write `struct libname_something : libname_other_struct` in my Crystal lib?
<jhass> uh, not sure that's supported yet
<jeromegn> I tried the obvious `struct Something < OtherStruct` but that’s not allowed
<jhass> >> lib Foo; struct A; a : UInt8; end; struct B < A; b : UInt8; end; end;
<DeBot> jhass: Syntax error in eval:4: expecting identifier 'end', not '<' - http://carc.in/#/r/31d
<jeromegn> yea
<jhass> do you need access to the fields?
<jeromegn> I wonder how inheritance works… I could maybe just copy and paste the fields
<jeromegn> not sure yet haha
<jhass> >> lib Foo; struct A; a : UInt8; end; struct B; a : A; b : UInt8; end; end;
<DeBot> jhass: # => nil - http://carc.in/#/r/31h
<jhass> I'd assume that generates the same fields
<jhass> er, size rather
<jeromegn> yea
<jeromegn> probably!
<jhass> though I have no idea, just a guess :P
<jeromegn> I’ll just try it!
<jeromegn> other question: how about passing structs to functions?
<jhass> >> lib Foo; struct A; a : UInt8; end; struct B; a : A; b : UInt8; end; end; sizeof(Foo::B)
<DeBot> jhass: # => 2 - http://carc.in/#/r/31i
<jeromegn> sass_option_set_c_functions (struct Sass_Options* options, Sass_Function_List c_functions);
<jeromegn> libsass is another edgy one damnit
<jhass> the former is just a pointer
<jhass> fun sass_option_set_c_functions(options : SassOptions*, c_functions : SassFunctionList)
<jeromegn> ah, interesting
<BlaXpirit> what's the lib?
<jhass> looks like libsass
<BlaXpirit> yeah, easy to google even by function name, nvm
<jeromegn> :)
<jeromegn> I probably don’t need to define all these guys
<jeromegn> probably just need the ones in this examples: https://github.com/sass/libsass/wiki/API-Documentation
<jhass> jeromegn: from the example you don't need to allocate the structs yourself, right?
<jeromegn> yea
<jhass> just alias them to Void then
<jhass> type SassOptions = Void
<jeromegn> I’ll attempt that :)
<BlaXpirit> https://github.com/BlaXpirit/crystalize.py should work on this
<jeromegn> interesting
<jeromegn> I’ve seen a few generator as of late
<jeromegn> I guess the process is pretty automatable
<jeromegn> I’ll give it a shot
<jeromegn> BlaXpirit: not working out of the box.
mdz_ has quit [Remote host closed the connection]
mdz_ has joined #crystal-lang
<BlaXpirit> that sux
<jeromegn> hehe, that lib is weird
<jeromegn> BlaXpirit: here’s the gist: https://gist.github.com/jeromegn/9d2675c4e207d8f3c6e6
<BlaXpirit> i will look into this in about 15 minutes
<BlaXpirit> jeromegn, i pushed some fixes. doesn't crash anymore
<BlaXpirit> but it will be problematic because there is no single header
<BlaXpirit> one solution is to make a header which includes all headers of that library
NeverDie has joined #crystal-lang
<jeromegn> BlaXpirit: yea that did work
<BlaXpirit> so is the generated code worth anything? :p
<jeromegn> this workes
<jeromegn> *works
<jeromegn> yep!
<jeromegn> had to add a few things, but not much!
<BlaXpirit> give feedback so i can improve it
mdz_ has quit [Remote host closed the connection]
<jeromegn> an option to remove the lib’s prefix maybe?
flaviu has joined #crystal-lang
<jeromegn> it was missing one or two
<BlaXpirit> jeromegn, edit code for that :/
<jeromegn> structs
<jeromegn> oh yea?
<BlaXpirit> missing structs? that's strange :o
<flaviu> BlaXpirit: You mentioned bringing up different regex handling in a PM. How long ago was this (so I can look it up in the logs)
<jeromegn> and double structs
<BlaXpirit> flaviu, no idea
<BlaXpirit> jeromegn, outdated example.. https://gist.github.com/BlaXpirit/136d5d5fc9f3f531d663
<BlaXpirit> if u can, write an issue about these missing structs, i don't know what you're talking about
havenwood has joined #crystal-lang
havenn has joined #crystal-lang
havenwood has quit [Ping timeout: 265 seconds]
havenn has quit [Ping timeout: 245 seconds]
vifino has quit [Read error: Connection reset by peer]
flaviu has quit [Remote host closed the connection]
mdz_ has joined #crystal-lang
mdz_ has quit [Ping timeout: 255 seconds]
willlll has joined #crystal-lang
willlll has quit [Client Quit]
Ven has joined #crystal-lang
Ven has quit [Client Quit]
BlaXpirit has quit [Quit: Quit Konversation]
Liothen has quit [Ping timeout: 264 seconds]
Liothen has joined #crystal-lang
havenwood has joined #crystal-lang
havenn has joined #crystal-lang
havenwood has quit [Ping timeout: 256 seconds]