00:02
kulelu88 has quit [Quit: Leaving]
00:06
jtarchie has quit [Quit: Connection closed for inactivity]
00:07
NeverDie has joined #crystal-lang
00:31
unshadow has quit [Ping timeout: 276 seconds]
01:01
Cidan is now known as zz_Cidan
01:08
BlaXpirit has quit [Quit: Quit Konversation]
01:15
datanoise has quit [Ping timeout: 244 seconds]
01:32
zz_Cidan is now known as Cidan
01:52
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
02:11
datanoise has joined #crystal-lang
02:16
bhishma has quit [Ping timeout: 255 seconds]
02:30
havenwood has quit [Ping timeout: 252 seconds]
02:34
Dreamer3 has quit [Quit: Computer has gone to sleep.]
02:48
datanoise has quit [Ping timeout: 244 seconds]
03:15
havenwood has joined #crystal-lang
04:01
willl has quit [Quit: Connection closed for inactivity]
04:02
havenwood has quit [Ping timeout: 244 seconds]
04:22
havenwood has joined #crystal-lang
05:07
mdz_ has joined #crystal-lang
05:09
strcmp1 has joined #crystal-lang
05:11
Cidan is now known as zz_Cidan
06:30
havenwood has quit [Ping timeout: 276 seconds]
07:13
BlaXpirit has joined #crystal-lang
07:24
Dreamer3 has joined #crystal-lang
07:38
willl has joined #crystal-lang
07:38
mdz_ has quit [Remote host closed the connection]
07:43
Benoist has quit [Quit: Page closed]
07:53
mdz_ has joined #crystal-lang
08:06
mdz_ has quit [Remote host closed the connection]
08:07
mdz_ has joined #crystal-lang
08:08
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
08:09
datanoise has joined #crystal-lang
08:10
Ven has joined #crystal-lang
08:12
mdz_ has quit [Ping timeout: 264 seconds]
08:13
datanoise has quit [Ping timeout: 272 seconds]
08:19
bhishma has joined #crystal-lang
10:01
willl has quit [Quit: Connection closed for inactivity]
10:12
xd1le has joined #crystal-lang
10:13
<
xd1le >
How do I reference a capturing group in for example gsub?
10:14
<
jhass >
unlike ruby you get the MatchData yielded
10:14
<
jhass >
and I prefer that over using $~
10:14
<
jhass >
>> "foo".gsub(/f(o)o/) {|m| m[1].upcase }
10:15
<
xd1le >
ooo that's nice
10:16
<
xd1le >
(both the solution and your bot)
10:17
tilpner has joined #crystal-lang
10:38
xd1le has quit [Ping timeout: 250 seconds]
10:52
xd1le has joined #crystal-lang
10:52
xd1le is now known as Guest74991
10:53
Guest74991 has quit [Client Quit]
10:58
datanoise has joined #crystal-lang
11:03
datanoise has quit [Ping timeout: 245 seconds]
11:36
unshadow has joined #crystal-lang
11:57
bhishma has quit [Remote host closed the connection]
11:58
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
12:15
Ven has joined #crystal-lang
12:39
mdz_ has joined #crystal-lang
12:39
unshadow has quit [Ping timeout: 252 seconds]
12:43
mdz_ has quit [Ping timeout: 245 seconds]
12:48
havenwood has joined #crystal-lang
12:53
Ven is now known as Guest81620
12:54
Guest81620 is now known as Ven_
13:17
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:44
Ven_ has joined #crystal-lang
14:29
asterite has joined #crystal-lang
14:29
<
asterite >
jhass: note that gsub yields the string and the match... maybe we should change that
14:29
mdz_ has joined #crystal-lang
14:29
<
asterite >
And also: I'm starting to dislike the magic $ variables :-/
14:29
<
asterite >
Gotta go now!
14:31
jhass has quit [Excess Flood]
14:32
jhass has joined #crystal-lang
14:32
mdz_ has quit [Remote host closed the connection]
14:32
unshadow has joined #crystal-lang
14:32
<
unshadow >
>> "foo" =~ /f(.*?)/i; puts $1
14:33
<
unshadow >
>> "foo" =~ /f(.*?)/i; puts $2
14:34
asterite has quit [Ping timeout: 246 seconds]
14:37
unshadow has quit [Ping timeout: 252 seconds]
14:42
datanoise has joined #crystal-lang
14:44
mdz_ has joined #crystal-lang
14:50
unshadow has joined #crystal-lang
14:51
mdz_ has quit [Remote host closed the connection]
14:52
mdz_ has joined #crystal-lang
15:00
unshadow has quit [Ping timeout: 252 seconds]
15:15
icezimm has joined #crystal-lang
15:20
havenwood has quit [Ping timeout: 264 seconds]
15:21
NeverDie has joined #crystal-lang
15:43
willl has joined #crystal-lang
15:53
wmoxam has quit [Ping timeout: 246 seconds]
15:57
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
16:04
datanoise has quit [Ping timeout: 256 seconds]
16:17
mdz_ has quit [Remote host closed the connection]
16:19
wmoxam has joined #crystal-lang
16:24
mdz_ has joined #crystal-lang
16:31
datanoise has joined #crystal-lang
16:41
bogen has left #crystal-lang [#crystal-lang]
16:51
jeromegn has joined #crystal-lang
17:00
datanoise has quit [Ping timeout: 276 seconds]
17:10
mdz_ has quit [Remote host closed the connection]
17:11
mdz_ has joined #crystal-lang
17:15
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
17:16
mdz_ has quit [Ping timeout: 265 seconds]
17:44
<
jeromegn >
I’m rusty
17:57
datanoise has joined #crystal-lang
18:01
datanoise has quit [Ping timeout: 252 seconds]
18:06
mdz_ has joined #crystal-lang
18:23
<
jbye >
>> ["a", "b", "c"].map(&:capitalize)
18:24
<
jbye >
>> ["a", "b", "c"].map(&.capitalize)
18:29
<
jhass >
>> %w(a b c d].map(&.ord.to_s(2))
18:29
<
jhass >
>> %w(a b c d).map(&.ord.to_s(2))
18:30
<
jhass >
>> %w(a b c d).map(&.chars.first.ord.to_s(2))
18:30
mdz_ has quit [Remote host closed the connection]
18:32
mdz_ has joined #crystal-lang
18:35
bcardiff has joined #crystal-lang
18:47
zipR4ND has joined #crystal-lang
18:53
zipR4ND has quit [Ping timeout: 272 seconds]
19:01
<
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?
19:03
<
jhass >
uh, not sure that's supported yet
19:04
<
jeromegn >
I tried the obvious `struct Something < OtherStruct` but that’s not allowed
19:04
<
jhass >
>> lib Foo; struct A; a : UInt8; end; struct B < A; b : UInt8; end; end;
19:04
<
jhass >
do you need access to the fields?
19:05
<
jeromegn >
I wonder how inheritance works… I could maybe just copy and paste the fields
19:05
<
jeromegn >
not sure yet haha
19:05
<
jhass >
>> lib Foo; struct A; a : UInt8; end; struct B; a : A; b : UInt8; end; end;
19:05
<
jhass >
I'd assume that generates the same fields
19:05
<
jhass >
er, size rather
19:05
<
jeromegn >
probably!
19:06
<
jhass >
though I have no idea, just a guess :P
19:07
<
jeromegn >
I’ll just try it!
19:07
<
jeromegn >
other question: how about passing structs to functions?
19:07
<
jhass >
>> lib Foo; struct A; a : UInt8; end; struct B; a : A; b : UInt8; end; end; sizeof(Foo::B)
19:07
<
jeromegn >
sass_option_set_c_functions (struct Sass_Options* options, Sass_Function_List c_functions);
19:07
<
jeromegn >
libsass is another edgy one damnit
19:08
<
jhass >
the former is just a pointer
19:08
<
jhass >
fun sass_option_set_c_functions(options : SassOptions*, c_functions : SassFunctionList)
19:09
<
jeromegn >
ah, interesting
19:11
<
BlaXpirit >
what's the lib?
19:12
<
jhass >
looks like libsass
19:12
<
BlaXpirit >
yeah, easy to google even by function name, nvm
19:14
<
jeromegn >
I probably don’t need to define all these guys
19:21
<
jhass >
jeromegn: from the example you don't need to allocate the structs yourself, right?
19:22
<
jhass >
just alias them to Void then
19:22
<
jhass >
type SassOptions = Void
19:22
<
jeromegn >
I’ll attempt that :)
19:41
<
jeromegn >
interesting
19:41
<
jeromegn >
I’ve seen a few generator as of late
19:41
<
jeromegn >
I guess the process is pretty automatable
19:41
<
jeromegn >
I’ll give it a shot
19:47
<
jeromegn >
BlaXpirit: not working out of the box.
19:55
mdz_ has quit [Remote host closed the connection]
19:56
mdz_ has joined #crystal-lang
19:56
<
BlaXpirit >
that sux
19:56
<
jeromegn >
hehe, that lib is weird
19:57
<
BlaXpirit >
i will look into this in about 15 minutes
20:13
<
BlaXpirit >
jeromegn, i pushed some fixes. doesn't crash anymore
20:14
<
BlaXpirit >
but it will be problematic because there is no single header
20:14
<
BlaXpirit >
one solution is to make a header which includes all headers of that library
20:36
NeverDie has joined #crystal-lang
20:47
<
jeromegn >
BlaXpirit: yea that did work
21:06
<
BlaXpirit >
so is the generated code worth anything? :p
21:11
<
jeromegn >
this workes
21:11
<
jeromegn >
had to add a few things, but not much!
21:12
<
BlaXpirit >
give feedback so i can improve it
21:16
mdz_ has quit [Remote host closed the connection]
21:16
<
jeromegn >
an option to remove the lib’s prefix maybe?
21:16
flaviu has joined #crystal-lang
21:16
<
jeromegn >
it was missing one or two
21:16
<
BlaXpirit >
jeromegn, edit code for that :/
21:17
<
BlaXpirit >
missing structs? that's strange :o
21:19
<
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)
21:19
<
jeromegn >
and double structs
21:20
<
BlaXpirit >
flaviu, no idea
21:22
<
BlaXpirit >
if u can, write an issue about these missing structs, i don't know what you're talking about
21:31
havenwood has joined #crystal-lang
22:09
havenn has joined #crystal-lang
22:10
havenwood has quit [Ping timeout: 265 seconds]
22:13
havenn has quit [Ping timeout: 245 seconds]
22:13
vifino has quit [Read error: Connection reset by peer]
22:14
flaviu has quit [Remote host closed the connection]
22:17
mdz_ has joined #crystal-lang
22:21
mdz_ has quit [Ping timeout: 255 seconds]
23:00
willlll has joined #crystal-lang
23:00
willlll has quit [Client Quit]
23:00
Ven has joined #crystal-lang
23:02
Ven has quit [Client Quit]
23:03
BlaXpirit has quit [Quit: Quit Konversation]
23:29
Liothen has quit [Ping timeout: 264 seconds]
23:30
Liothen has joined #crystal-lang
23:45
havenwood has joined #crystal-lang
23:48
havenn has joined #crystal-lang
23:50
havenwood has quit [Ping timeout: 256 seconds]