00:04
<
kulelu88 >
anybody still around?
00:23
<
havenwood >
kulelu88: hi
00:24
<
kulelu88 >
hey havenwood . How familiar are you with Crystal?
00:24
leafybasil has joined #crystal-lang
00:26
<
havenwood >
kulelu88: Just that, familiarity--not proficiency and certainly not mastery.
00:26
<
havenwood >
kulelu88: Why do you ask?
00:28
<
havenwood >
kulelu88: I'm unfamiliar with Quorum.
00:28
<
kulelu88 >
not many folks should be :D very very small language
00:29
<
kulelu88 >
I really dig the syntax of it
00:29
<
kulelu88 >
reads like english
00:31
ismaelga has joined #crystal-lang
00:35
<
fowl >
Can't find example syntaxes
00:36
<
kulelu88 >
fowl: see on the right where you can run code
00:36
<
kulelu88 >
actions, loops, classes, etc.
00:36
<
kulelu88 >
only catch is that it is a JVM language
00:49
ismael_ has joined #crystal-lang
00:51
ismaelga has quit [Ping timeout: 272 seconds]
00:53
<
Dreamer3 >
can i not use a macro inside a complex statement?
00:53
<
Dreamer3 >
macro xwhen x
00:53
<
Dreamer3 >
{{"when #{x}"}}
00:54
<
Dreamer3 >
inside a case, etc
00:54
<
Dreamer3 >
i thought the macro would have been substituted before the compile
00:58
Cidan is now known as zz_Cidan
01:08
vikaton has joined #crystal-lang
01:14
<
Dreamer3 >
how can i count up in a macro
01:14
<
Dreamer3 >
number + doesn't seem to exist
01:14
<
Dreamer3 >
seems so basic
01:23
zz_Cidan is now known as Cidan
01:24
Cidan is now known as zz_Cidan
01:25
DerisiveLogic has quit [Ping timeout: 244 seconds]
01:30
zz_Cidan is now known as Cidan
01:33
Cidan is now known as zz_Cidan
01:39
CraigBuchek has joined #crystal-lang
01:43
<
Dreamer3 >
seems so basic
01:43
<
Dreamer3 >
{% x = 2 if x == 1 %}
01:43
<
Dreamer3 >
{% x = 1 if x == 0 %}
01:43
<
Dreamer3 >
works for very short loops
01:44
waterlink1 has joined #crystal-lang
01:44
<
vikaton >
>> x = 1; x = 1 if x==1; p x
01:44
<
vikaton >
DeBot is gone!
01:45
<
vikaton >
never fear!
01:45
<
vikaton >
detox is here!
01:45
detox has joined #crystal-lang
01:45
<
vikaton >
>> x = 1; x = 1 if x==1; p x
01:46
<
vikaton >
>> x = 1; x = 2 if x==1; p x
01:46
<
vikaton >
Warning: You have to print something, otherwise
01:46
<
vikaton >
>> x :: Int32;
01:46
<
detox >
vikaton: You have not printed anything
01:46
waterlink has quit [Ping timeout: 272 seconds]
01:52
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
01:55
ismael_ has quit [Ping timeout: 276 seconds]
02:00
<
vikaton >
>> p "1001".to_i(2)
02:01
<
vikaton >
>> p "food".to_s(2)
02:01
<
detox >
vikaton: Error in ./exec.cr:1: instantiating 'String#to_s(Int32)'
02:01
<
vikaton >
>> p "food".to_i(2)
02:02
<
vikaton >
>> p "hello".unpack("b*")
02:02
<
detox >
vikaton: Error in ./exec.cr:1: undefined method 'unpack' for String
02:04
<
vikaton >
>> p sizeof(Char)
02:05
willlll has quit [Quit: willlll]
02:06
<
vikaton >
whats the equivalent of char output[9] in Crystal?
02:09
<
vikaton >
>> p typeof(UInt8[9])
02:09
<
detox >
vikaton: Array(UInt8)
02:11
kulelu88 has quit [Quit: Leaving]
02:11
<
vikaton >
>> x = UInt8; p x
02:11
<
detox >
vikaton: UInt8
02:12
<
vikaton >
>> x :: UInt8[9]; p x
02:12
<
detox >
vikaton: [0, 110, 230, 111, 210, 255, 127, 0, 0]
02:13
detox has quit [Remote host closed the connection]
02:14
<
vikaton >
whats wrong with this?
02:14
<
vikaton >
fun itoa(ch : Char, ar : Array(UInt8), radix : Int32) : Int32
02:14
<
fowl >
Char is wrong to use there, ar should be a pointer type
02:15
<
fowl >
If you want itoa from c
02:15
<
vikaton >
Pointer(Char) ?
02:16
<
fowl >
Maybe out param, not sure how it works
02:16
<
vikaton >
this is C version
02:18
<
fowl >
char * itoa ( int value, char * str, int base );
02:19
<
vikaton >
so replace it with char* ?
02:19
<
vikaton >
kinda confused now
02:24
<
vikaton >
fowl, I ahve fun itoa(value : Int32, str : Array(UInt8), radix : Int32) : Int32 but I still get primitive errors
02:28
<
fowl >
give me a sec
02:44
<
fowl >
now i get undefined reference to `itoa'
02:49
<
vikaton >
yeah same
02:49
<
vikaton >
fowl, does it matter if z is a Pointer or like this
02:49
<
vikaton >
>> x = UInt8[9]; p x
02:51
DerisiveLogic has joined #crystal-lang
02:52
<
fowl >
I don't know. Hang on let me try snprintf
02:55
<
fowl >
Program terminated abnormally with error code: 139 :(
02:56
ismaelga has joined #crystal-lang
02:57
detox has joined #crystal-lang
02:58
<
vikaton >
>> x = Pointer(Int32).malloc(10); p &x;
02:58
<
detox >
vikaton: Error in ./exec.cr:1: [1mexpected a function type, not Pointer(Int32)[0m
02:58
<
vikaton >
>> x = Pointer(Int32).malloc(10); p *x;
02:58
<
detox >
vikaton: Error in ./exec.cr:1: [1msplatting a union (Pointer(Int32)) is not yet supported[0m
02:58
<
vikaton >
>> x = Pointer(Int32).malloc(10); p x*;
02:58
<
detox >
vikaton: Syntax error in ./exec.cr:1: [1munexpected token: ;[0m
03:04
<
vikaton >
>> x = Pointer(Int32).malloc(10); p x[0]
03:04
<
vikaton >
>> x = Pointer(Int32).malloc(10); p x[1]
03:04
<
vikaton >
>> x = Pointer(Int32).malloc(10); p x[10]
03:04
<
vikaton >
>> x = Pointer(Int32).malloc(10); p x[11]
03:10
<
vikaton >
>> x = Pointer(Int32).malloc(10); p x
03:10
<
vikaton >
>> x = Pointer(Int32).malloc(10); p x
03:10
<
detox >
vikaton: Pointer(Int32)@0x2175FC0
03:19
CraigBuchek has quit [Quit: Leaving.]
03:31
waterlink1 has quit [Ping timeout: 276 seconds]
03:54
havenwood has quit [Ping timeout: 276 seconds]
04:34
havenwood has joined #crystal-lang
05:00
detox has quit [Remote host closed the connection]
05:00
ismaelga has quit [Ping timeout: 244 seconds]
05:13
vikaton has quit [Quit: Connection closed for inactivity]
05:44
BlaXpirit has joined #crystal-lang
05:48
ismaelga has joined #crystal-lang
06:03
ismaelga has quit [Ping timeout: 276 seconds]
06:11
ismaelga has joined #crystal-lang
06:33
willlll has joined #crystal-lang
06:44
willlll has quit [Quit: willlll]
07:02
ismaelga has quit [Ping timeout: 272 seconds]
07:21
Ven has joined #crystal-lang
07:27
BlaXpirit has quit [Quit: Quit Konversation]
07:30
ismaelga has joined #crystal-lang
07:42
HakanD has joined #crystal-lang
07:48
sandelius has joined #crystal-lang
07:58
ismaelga has quit [Read error: Connection reset by peer]
08:13
ismaelga has joined #crystal-lang
08:21
ismaelga has quit [Read error: Connection reset by peer]
08:56
ismaelga has joined #crystal-lang
08:57
leafybasil has quit [Remote host closed the connection]
09:07
JBat has joined #crystal-lang
09:08
havenwood has quit [Ping timeout: 250 seconds]
09:13
<
Dreamer3 >
is there anyway to get a pointer to a function?
09:14
<
Dreamer3 >
like a func type?
09:14
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
09:15
<
Dreamer3 >
no the scope has to stay the same
09:15
DeBot has joined #crystal-lang
09:15
<
jhass >
mh, I never tried
09:15
<
Dreamer3 >
need to talk to ast
09:15
<
jhass >
now you confuse me
09:16
<
Dreamer3 >
i don't really want instance_eval, i just want to be able to specify the context in which a block will run upfront
09:16
<
jhass >
>> s = "foo"; f = ->s.upcase; f.call
09:16
<
Dreamer3 >
it seems if the compiler knew that that it would know everything needed to compile
09:17
<
jhass >
the host is having too many troubles :/
09:17
<
Dreamer3 >
i can't even create the block
09:17
<
Dreamer3 >
the compiler starts acting funny
09:18
<
Dreamer3 >
just moving the same code from outside the block into it
09:19
<
Dreamer3 >
and it doesn't even make sense
09:19
<
Dreamer3 >
in ./src/emulate/cpu.cr:158: instantiating 'push(UInt8, (UInt8 | UInt32), UInt8, UInt8)'
09:19
<
Dreamer3 >
i have no idae why it thinks the second arg could be int32
09:19
<
Dreamer3 >
i looked at all the places it's called
09:20
DeBot has quit [Ping timeout: 272 seconds]
09:20
leafybasil has joined #crystal-lang
09:20
leafybasil has quit [Remote host closed the connection]
09:21
<
Dreamer3 >
and it only acts weird when i put some code inside a block
09:21
leafybasil has joined #crystal-lang
09:21
ismaelga has quit [Remote host closed the connection]
09:25
<
Dreamer3 >
i figured it out
09:25
<
Dreamer3 >
once variable use was another type
09:25
<
Dreamer3 >
but the compiler didn't care until i starting trying to use a block
09:50
HakanD has quit [Quit: Be back later ...]
09:51
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
09:56
DerisiveLogic has quit [Ping timeout: 255 seconds]
09:58
Ven has joined #crystal-lang
10:04
leafybas_ has joined #crystal-lang
10:07
leafybasil has quit [Ping timeout: 246 seconds]
10:14
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
10:20
sandelius has joined #crystal-lang
10:31
jhass has quit [Quit: Bye]
10:32
<
Dreamer3 >
how do i use splats?
10:36
vikaton has joined #crystal-lang
10:39
jhass has joined #crystal-lang
10:40
blaix has joined #crystal-lang
10:41
detox has joined #crystal-lang
10:41
<
vikaton >
jhass, where did DeBot go?
10:41
<
jhass >
vikaton: massive loss on the internal v6 network on the VM
10:42
<
vikaton >
jhass, well u got detox now :P
10:42
<
vikaton >
>> p "hi"
10:42
<
detox >
vikaton: "hi"
10:43
<
jhass >
>> RUBY_VERSION
10:43
detox has quit [Remote host closed the connection]
10:43
detox has joined #crystal-lang
10:43
<
vikaton >
now u can try
10:44
<
vikaton >
>> p CRYSTAL_VERSION
10:44
<
detox >
vikaton: Error in ./exec.cr:1: [1mundefined constant CRYSTAL_VERSION[0m
10:46
<
detox >
cannot let u do that
10:47
<
jhass >
>> Process.run("/usr/bin/ls")
10:47
<
detox >
jhass: You have not printed anything
10:47
<
jhass >
>> p Process.run("/usr/bin/ls")
10:47
<
detox >
jhass: #<Process::Status:0x2514FC0 @pid=15693, @exit=127, @output=nil>
10:47
<
jhass >
>> p Process.run("/usr/bin/ls", output: true).output
10:47
<
jhass >
>> p Process.run("/usr/bin/ls", {"/"} output: true).output
10:47
<
detox >
jhass: Syntax error in ./exec.cr:1: [1mexpecting token ')', not 'output'[0m
10:47
<
jhass >
>> p Process.run("/usr/bin/ls", {"/"}, output: true).output
10:47
<
jhass >
>> p Process.run("/bin/ls", {"/"}, output: true).output
10:47
<
detox >
jhass: "bin\nboot\ndev\netc\nhome\ninitrd.img\nlib\nlib64\nlost+found\nmedia\nmnt\nopt\nproc\nroot\nrun\nsbin\nselinux\nsrv\nsys\ntmp\nusr\nvar\nvmlinuz\n"
10:47
detox has quit [Remote host closed the connection]
10:48
<
jhass >
give up, you just don't know enough
10:48
<
vikaton >
I know I don't
10:49
<
vikaton >
was thinking since Debot isnt here, I would help out a bit
10:49
<
vikaton >
and not rly have people trying to break
10:51
<
vikaton >
jhass, did you see the itoa issue in google groups?
10:52
HakanD has joined #crystal-lang
10:52
<
jhass >
yeah, no time atm sorry
10:56
<
vikaton >
I have an AP Java exam in 30 minutes :P
10:56
leafybas_ has quit [Read error: Connection reset by peer]
10:56
HakanD has quit [Ping timeout: 245 seconds]
10:56
leafybasil has joined #crystal-lang
11:17
leafybasil has quit [Remote host closed the connection]
11:18
leafybasil has joined #crystal-lang
11:28
BlaXpirit has joined #crystal-lang
11:34
HakanD has joined #crystal-lang
11:36
DeBot has joined #crystal-lang
12:01
blaix has quit [Quit: Leaving.]
12:03
waj has joined #crystal-lang
12:06
<
jeromegn >
I don’t know how to use it though
12:17
<
jeromegn >
that’s a commit due to a bug I got from the compiler :P
12:18
<
jeromegn >
so there are ways to get access to direct values and stuff without having to define that struct
12:18
<
jeromegn >
*those structs
12:19
<
jeromegn >
but there are still some I’d have to define which also have the aligned thing
12:19
<
jhass >
well, if you know the pointer offsets... :P
12:20
<
jeromegn >
reading about it, it sounds like it would be equivalent to doing what you suggested before… if I know the number of bytes of the struct, I can just add one jank property to it (_data) that defines a correct number of bytes
12:20
<
jeromegn >
that alignment thing seems to mean: “that struct will occupy at least that many bytes)
12:20
<
jeromegn >
“This attribute specifies a minimum alignment (in bytes) for variables of the specified type.”
12:21
<
jhass >
I guess there are 3 options: figure out the exact behavior of aligned in C and implement it in Crystal, figure out the exact behavior of aligned and fake it with dummy struct members, write a C lib that exposes what you need to access as API and works with only pointers to the struct
12:22
<
jeromegn >
I didn’t pick the easiest lib eh?
12:22
<
jeromegn >
at least my work might help others hah
12:25
waterlink has joined #crystal-lang
12:25
waj has quit [Quit: waj]
12:25
<
jeromegn >
I’ll try a struct with _data : UInt8[128]
12:26
ismaelga has joined #crystal-lang
12:26
<
crystal-gh >
crystal/master fe8f3a3 Ary Borenszweig: Markdown: replace `<` with `<`
12:26
<
crystal-gh >
crystal/master 241be89 Ary Borenszweig: Optimized and simplified Int#to_s. Related to #632
12:54
<
jeromegn >
ok this is not really working :(
12:54
waj has joined #crystal-lang
12:56
<
jeromegn >
uint8_t padding[120]; /* Padding for stack allocation. */
12:56
<
jeromegn >
they say that struct should be 128 bytes… and they add 120 bytes of padding
12:57
<
jeromegn >
Is UInt8 appropriate for padding in general^
12:57
<
jeromegn >
struct BSON; _data : UInt8[128]; end
12:58
<
jeromegn >
I guess I can do alias BSON = UInt8[128]
13:03
vikaton has quit [Quit: Connection closed for inactivity]
13:13
waterlink has quit [Ping timeout: 264 seconds]
13:26
waterlink has joined #crystal-lang
13:47
bcardiff has joined #crystal-lang
14:16
willlll has joined #crystal-lang
14:33
Ven has joined #crystal-lang
14:58
HakanD has quit [Quit: Be back later ...]
15:00
HakanD has joined #crystal-lang
15:02
havenwood has joined #crystal-lang
15:04
HakanD has quit [Ping timeout: 240 seconds]
15:10
<
jeromegn >
>> (1 << 2)
15:10
<
DeBot >
jeromegn: 4
15:10
<
jeromegn >
>> p (1 << 2)
15:10
<
DeBot >
jeromegn: 4
15:13
HakanD has joined #crystal-lang
15:31
waj has quit [Quit: waj]
15:51
<
jeromegn >
>> (1 << 0)
15:51
<
DeBot >
jeromegn: 1
15:54
HakanD has quit [Quit: Be back later ...]
15:55
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
16:02
blaix has joined #crystal-lang
16:22
aemadrid has joined #crystal-lang
16:33
strcmp1 has quit [Remote host closed the connection]
16:45
waj has joined #crystal-lang
16:47
leafybasil has quit [Ping timeout: 244 seconds]
16:57
vikaton has joined #crystal-lang
17:08
shadeslayer has quit [Ping timeout: 245 seconds]
17:09
shadeslayer has joined #crystal-lang
17:20
ismaelga has quit [Remote host closed the connection]
17:33
shama has joined #crystal-lang
17:50
zz_Cidan is now known as Cidan
17:52
Cidan is now known as zz_Cidan
17:52
zz_Cidan is now known as Cidan
17:54
leafybasil has joined #crystal-lang
17:58
leafybasil has quit [Ping timeout: 246 seconds]
18:01
jtarchie has joined #crystal-lang
18:07
<
jeromegn >
>> Double
18:07
<
DeBot >
jeromegn: Error in line 3: undefined constant Double
18:08
<
jeromegn >
>> double
18:08
<
DeBot >
jeromegn: Error in line 3: undefined local variable or method 'double'
18:08
DeBot has quit [Remote host closed the connection]
18:08
jhass has quit [Quit: Bye]
18:14
canhtak has joined #crystal-lang
18:15
jhass has joined #crystal-lang
18:16
jhass has quit [Excess Flood]
18:17
jhass has joined #crystal-lang
18:24
jhass has quit [Ping timeout: 272 seconds]
18:27
aemadrid has quit [Quit: Connection closed for inactivity]
18:28
<
jeromegn >
finally...
18:28
<
jeromegn >
was able to run a Mongo command...
18:28
<
jeromegn >
basically had to implement the full freaking BSON lib
18:29
jhass has joined #crystal-lang
18:30
DeBot has joined #crystal-lang
18:32
<
jeromegn >
jhass: so, I was finally able to run a MongoDB command. The whole reason I was implementing BSON was because MongoDB requires it for everything pretty much (queries, commands, etc.)
18:33
<
jeromegn >
I’ll be able to push that out to Github pretty soon I hope.
18:42
<
jeromegn >
anybody working on a package manager? it’s a pretty important bit
18:48
willlll has quit [Quit: willlll]
18:54
<
jhass >
crystal deps is all we have atm
19:14
<
jeromegn >
hmm, time comparison is not so great.
19:21
<
jeromegn >
jhass: so, should I add finalize methods in my classes. libbson provides a few things to destroy certain objects when the program is done with it
19:22
<
jhass >
sounds like it then
19:23
<
jeromegn >
cool, just making sure that’s where it goes
19:23
<
jhass >
basically for pointers you get for stuff that you didn't allocate but then are responsible for (C devs use to call that transfer ownership), you want finalizers
19:26
JBat has quit [Quit: Computer has gone to sleep.]
19:30
willlll has joined #crystal-lang
19:33
vikaton has quit []
19:46
vikaton has joined #crystal-lang
19:48
<
jeromegn >
>> Time.utc_now.to_json
19:48
<
DeBot >
jeromegn: Error in line 3: undefined method 'to_json' for Time
19:48
<
jeromegn >
interesting
19:49
<
jeromegn >
>> Time.utc_now.to_s
19:49
<
DeBot >
jeromegn: "2015-05-07 19:49:38 UTC"
19:49
<
jhass >
>> require "json"; Time.utc.now.to_json
19:49
<
DeBot >
jhass: Error in line 3: undefined method 'utc' for Time:Class
19:49
<
jeromegn >
underscore
19:50
<
jeromegn >
>> require "json"; Time.utc_now.to_json
19:50
<
DeBot >
jeromegn: in /usr/lib/crystal/json/to_json.cr:4: wrong number of arguments for 'Time#to_json' (1 for 0)
19:50
<
jeromegn >
same result I get here
19:50
<
jeromegn >
sounds like something that can be improved
19:50
<
jeromegn >
I can’t quite trace it though
19:50
<
jhass >
>> require "json"; String.build do |io| Time.utc_now.to_json(io); end
19:50
<
DeBot >
jhass: in line 3: wrong number of arguments for 'Time#to_json' (1 for 0)
19:53
<
jeromegn >
by default to_json passes the io object...
19:53
<
jeromegn >
what is that anyway
19:54
<
jeromegn >
oh I see, it’s a string
19:54
<
jhass >
a StringIO usually, I think
19:56
<
jeromegn >
def to_json(io)
19:56
<
jeromegn >
to_s.to_json(io)
19:56
<
jeromegn >
I put that ^^ in the Time stuct
20:07
<
vikaton >
Java is gone
20:08
ismaelga has joined #crystal-lang
20:08
<
BlaXpirit >
you can wish
20:16
waj_ has joined #crystal-lang
20:17
<
vikaton >
BlaXpirit: I took the AP Java exam today, its gone for me
20:18
<
BlaXpirit >
Java 7 was indeed discontinued recently :|
20:18
waj has quit [Ping timeout: 255 seconds]
20:18
waj_ is now known as waj
20:20
HakanD has joined #crystal-lang
20:22
ismaelga has quit [Remote host closed the connection]
20:27
canhtak has quit [Quit: canhtak]
20:33
ismaelga has joined #crystal-lang
20:35
bcardiff has quit [Quit: Leaving.]
21:08
<
jeromegn >
>> /hello/i.inspect
21:08
<
DeBot >
jeromegn: "/hello/"
21:09
<
jeromegn >
>> /hello/imx.inspect
21:09
<
DeBot >
jeromegn: "/hello/"
21:09
<
jeromegn >
>> /hello/imxa.inspect
21:09
<
DeBot >
jeromegn: Syntax error in eval:3: unknown regex option: a
21:11
<
jeromegn >
I wonder if there’s a way to get the modifiers
21:14
<
jhass >
mh, inspect should include them, bug IMO
21:15
<
jhass >
jeromegn: ^5
21:15
<
jeromegn >
I just logged it on GH :D
21:15
<
jeromegn >
you’re watching it I imagine heh
21:16
<
jeromegn >
I should contribute some docs
21:16
<
jeromegn >
I did see that project before :)
21:16
<
jeromegn >
I wonder if libnotify works on OS X
21:17
<
jeromegn >
jhass: so while you’re here :) my current valgrind issue is
21:17
<
jeromegn >
==89042== Jump to the invalid address stated on the next line
21:18
<
jeromegn >
==89042== at 0xFFFFFFFFFFFFFF: ???
21:18
<
jeromegn >
==89042== Address 0xffffffffffffff is not stack'd, malloc'd or (recently) free'd
21:18
<
jeromegn >
that looks like an odd address
21:18
<
jhass >
jeromegn: it doesn't
21:18
<
jeromegn >
I kept implementing stuff, attempting to reproduce this error, but it only happens with one specific method
21:18
sfcgeorge has joined #crystal-lang
21:18
<
jhass >
mh, never saw that one before, congratz :D
21:20
<
jhass >
does it expect a function pointer or anything?
21:23
<
jhass >
how do you initialize offset?
21:23
<
jeromegn >
offset :: UInt8
21:23
<
jeromegn >
I tried offset = UInt8.cast(0)
21:24
<
jeromegn >
the library is almost complete :)
21:24
<
jhass >
try out offset (without prior declaration)
21:25
<
jhass >
also debug print to_unsafe.address
21:25
<
jeromegn >
for the BSON::Document?
21:25
<
jeromegn >
how can I send the offset without prior declaration?
21:26
<
jhass >
out declares it
21:27
<
jeromegn >
could that be an issue? “A bitwise-or of all desired bson_validate_flags_t.”
21:27
<
jeromegn >
bitwise-or
21:27
<
jhass >
well, that just means that you only validate UTF8 atm and none of the other things
21:27
<
jeromegn >
“undefined local variable or method 'offset’”
21:28
<
jhass >
(that have flags)
21:28
<
jhass >
, out offset)
21:28
<
jeromegn >
same error
21:28
<
jeromegn >
to_unsafe.address 4304858256
21:31
<
jhass >
you don't allocate the BSON document yourself, right?
21:31
<
jeromegn >
no, I use bson_new from the C driver
21:31
<
jeromegn >
I did define its struct
21:31
<
jeromegn >
but even when not defined, using the padding trick, I still get the same issues.
21:32
<
jhass >
isn't size_t Int32 or Int64?
21:32
<
jeromegn >
Not sure :)
21:32
<
jhass >
I think we have an alias for that in LibC somewhere already
21:32
<
jeromegn >
oh that would be nice
21:33
<
jeromegn >
LibC::SizeT
21:33
<
jhass >
src/libc.cr:19: alias SizeT = UIntT
21:33
<
jeromegn >
that fixed it
21:33
<
jeromegn >
rejoice!
21:33
<
jeromegn >
now I need to lookup the other places I used that...
21:34
<
jeromegn >
thanks again, life saver
21:34
leafybasil has joined #crystal-lang
21:35
<
jhass >
took way too long to see that :P
21:38
blaix has quit [Quit: Leaving.]
21:43
<
crystal-gh >
crystal/master ce3280d Ary Borenszweig: Removed githalytics from Readme
21:43
<
crystal-gh >
crystal/master a9492d8 Ary Borenszweig: Document Range, and added `Range#step` iterator.
21:43
<
crystal-gh >
crystal/master 4834249 Ary Borenszweig: Mark several types with nodoc. Improved internal Iterator names.
21:55
<
crystal-gh >
crystal/master 3af1fa4 Ary Borenszweig: Renamed ArrayIterator to ItemIterator for consistency
21:55
<
crystal-gh >
crystal/master 01e5265 Ary Borenszweig: Fixed silly mistake in Range#step
22:04
<
jeromegn >
that’s probably a bit intense eh? alias AcceptedType = String | Time | Int32 | Int64 | Float64 | Document | Bool | Array(AcceptedType) | Hash(String | Symbol, AcceptedType)
22:04
<
jeromegn >
I think I’m messing up the compiler :)
22:05
<
jhass >
Json::Type looks about the same ;P
22:05
<
jeromegn >
I thought Array((String | Int32)) would be an AcceptedType
22:06
<
jeromegn >
(I inspired from Json::Type for this)
22:06
waj has quit [Quit: waj]
22:06
<
jeromegn >
hmm, why the double parens...
22:07
<
jhass >
mh, yeah weird
22:08
<
jeromegn >
I changed the code slightly and now
22:08
<
jeromegn >
/usr/local/bin/crystal: line 6: 94855 Segmentation fault: 11 "$INSTALL_DIR/embedded/bin/crystal" "$@"
22:09
<
jhass >
recursive aliases ... ;)
22:09
<
travis-ci >
manastech/crystal#2313 (master - 232010c : Ary Borenszweig): The build is still failing.
22:11
<
jeromegn >
yea maybe...
22:11
<
jeromegn >
so I guess I should separate that huge alias into a few
22:12
<
jhass >
you probably found a bug in crystal though
22:12
<
jhass >
the recursive alias code had a couple already
22:12
<
jhass >
I bet it's a stackoverflow if you valgrind it
22:18
<
jeromegn >
how can I work around that?
22:19
<
jeromegn >
I can’t build it, so I can’t valgrind it
22:19
<
jeromegn >
unless there’s some valgrind trick :)
22:19
<
jhass >
my workaround for these kind of bugs is to complain to asterite :P
22:19
<
jhass >
oh, you can valgrind the compiler ;=
22:19
<
jeromegn >
oh, indeed
22:20
canhtak has joined #crystal-lang
22:20
<
jeromegn >
valgrind just shows its small intro and then gives me the same error
22:21
<
travis-ci >
manastech/crystal#2314 (master - 01e5265 : Ary Borenszweig): The build is still failing.
22:21
<
jeromegn >
valgrind /usr/local/bin/crystal spec
22:31
CraigBuchek has joined #crystal-lang
22:33
vikaton has quit [Quit: Connection closed for inactivity]
22:35
havenwood has quit []
22:38
bcardiff has joined #crystal-lang
23:06
canhtak has quit [Quit: canhtak]
23:18
HakanD has quit [Quit: Be back later ...]
23:26
aemadrid has joined #crystal-lang
23:30
CraigBuchek has quit [Quit: Leaving.]
23:35
BlaXpirit is now known as Guest66546
23:35
BlaXpirit_ has joined #crystal-lang
23:35
Guest66546 has quit [Killed (orwell.freenode.net (Nickname regained by services))]