00:02
zipR4ND has quit [Read error: Connection reset by peer]
00:03
zipR4ND has joined #crystal-lang
00:09
Aytan72 has joined #crystal-lang
00:29
bjz has joined #crystal-lang
00:40
Aytan72 has quit []
01:25
kubaxvx__ has quit [Remote host closed the connection]
01:27
nickc2 has quit [Read error: Connection reset by peer]
02:55
Aytan72 has joined #crystal-lang
03:07
zipR4ND has quit [Ping timeout: 260 seconds]
03:19
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
03:34
_whitelogger has joined #crystal-lang
03:54
bjz has joined #crystal-lang
06:27
Aytan72 has quit []
06:39
<
FromGitter >
<schoening> What are "Free variables"
06:43
<
FromGitter >
<schoening> nvm found it in the docs
07:38
Qchmqs has joined #crystal-lang
09:31
_whitelogger has joined #crystal-lang
09:33
Raimondi has quit [Ping timeout: 268 seconds]
09:33
Raimondii is now known as Raimondi
10:25
Qchmqs has quit [Remote host closed the connection]
10:31
Yxhuvud has quit [Read error: Connection reset by peer]
10:32
Yxhuvud has joined #crystal-lang
10:33
Qchmqs__ has joined #crystal-lang
10:33
Qchmqs__ is now known as Qchmqs
10:35
onionhammer has quit [Ping timeout: 240 seconds]
10:38
Qchmqs has quit [Remote host closed the connection]
10:42
bjz_ has joined #crystal-lang
10:44
bjz has quit [Ping timeout: 240 seconds]
10:45
ben has joined #crystal-lang
10:47
Qchmqs__ has joined #crystal-lang
10:52
ChickeNES has quit [Ping timeout: 246 seconds]
10:53
<
FromGitter >
<bew> Whats the best way to pass an `Array(String)` to a C fun accepting `LibC::Char**` ?
10:55
<
oprypin >
bew, `that.map(&.to_unsafe)`
10:56
<
FromGitter >
<bew> nice, and the other way ? (from C to Cr)
10:56
<
oprypin >
well first you gotta know the size, right?
10:57
<
FromGitter >
<bew> yeah it's argv-style
10:57
<
oprypin >
`that.to_slice(size).map{ |p| String.new(p) }`
10:58
<
oprypin >
nevermind, it is a thing for a pointer, so myexample should wok
11:07
<
FromGitter >
<bew> interesting, now as `that` is a null-terminated vector of string, what would be the fastest way to determine the size?
11:08
<
FromGitter >
<bew> I would think using a while in C, but there's maybe a crystal-way of doing this kind of things
11:08
<
oprypin >
bew, you said it's argv style so size is separate
11:08
<
oprypin >
null terminated vector is silly
11:08
<
FromGitter >
<bew> ah, I meant it's null terminated
11:08
<
oprypin >
that's not normal for sure
11:08
zipR4ND has joined #crystal-lang
11:08
<
oprypin >
what are you working with anyway?
11:10
<
oprypin >
i think that calls for an entirely different approach
11:10
<
FromGitter >
<bew> I also think I'll need to store the pointer I give to `unibi_set_aliases` to avoid GC collecting..
11:10
<
oprypin >
you just make an empty array, until pointer.null? arr << String.new(pointer); pointer += 1
11:11
<
oprypin >
bew, you're right about that
11:11
<
oprypin >
better store the Array which is the result of `.map(&.to_unsafe)`
11:11
<
FromGitter >
<bew> yes for sure
11:11
<
FromGitter >
<bew> thanks!
11:40
<
FromGitter >
<bew> @oprypin works well ;) ty
11:44
splitty__ has joined #crystal-lang
11:48
splitty___ has quit [Ping timeout: 240 seconds]
12:29
jeromegn has quit [Remote host closed the connection]
12:29
poikon has quit [Remote host closed the connection]
12:37
Qchmqs__ is now known as Qchmqs
12:45
poikon has joined #crystal-lang
12:48
jeromegn has joined #crystal-lang
13:58
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
14:01
bjz has joined #crystal-lang
14:06
yogg-saron has joined #crystal-lang
14:18
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
14:35
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
15:05
Raimondi has quit [Ping timeout: 268 seconds]
15:27
<
Papierkorb >
MatthewBennington @@slot_counter is Int32.
15:27
<
FromGitter >
<MatthewBennington> Oh I see it
15:27
<
FromGitter >
<pta2002> the color enum is giving you Int32s, not Int16s like you're requesting
15:27
<
Papierkorb >
`1_16` is `116`
15:27
<
Papierkorb >
write `1u16` instead
15:27
<
FromGitter >
<MatthewBennington> I don't think it's an issue with the color enum though
15:29
<
FromGitter >
<MatthewBennington> Yeah `1_16` -> `1_i16` fixed it
15:29
<
Papierkorb >
apart from that, convention-wise the class should be called `ColorPair` (no underscore there), and the enum constants are written in camel-case
15:29
<
FromGitter >
<MatthewBennington> In this case I'm binding a c lib, is that still true?
15:30
<
Papierkorb >
You're writing Crystal code, that it binds to a c lib isn't important to the user of your class
15:30
<
FromGitter >
<MatthewBennington> Thanks
15:43
zipR4ND has quit [Ping timeout: 246 seconds]
15:45
<
FromGitter >
<KCreate> Does anyone know if `Hash#keys` returns the keys in the order they were added?
15:47
<
FromGitter >
<pta2002> @KCreate seems like it does
15:48
<
FromGitter >
<KCreate> Is this guaranteed or could this just be a coincidence?
15:48
<
FromGitter >
<pta2002> I wouldn't rely on it, but I'm not sure
15:48
<
FromGitter >
<pta2002> `{"a" => "A", "b" => "B", "d" => "B", "c" => "C"} ` is what it returns btw
15:52
<
Papierkorb >
KCreate, you can rely on it, Hash retains insertion-order
15:52
<
Papierkorb >
It's a feature
15:53
<
FromGitter >
<KCreate> Alright, thanks!
15:56
Qchmqs has quit [Ping timeout: 258 seconds]
16:02
onionhammer has joined #crystal-lang
16:41
Raimondi has joined #crystal-lang
16:41
Raimondi has quit [Client Quit]
16:42
Raimondi has joined #crystal-lang
17:25
Shad has joined #crystal-lang
17:49
p0p0pr37 has quit [Remote host closed the connection]
17:57
p0p0pr37 has joined #crystal-lang
18:01
<
FromGitter >
<MatthewBennington> Are there are things which are supposed to be snake_case, other than methods?
18:01
<
FromGitter >
<sdogruyol> variables
18:02
<
FromGitter >
<MatthewBennington> Thanks
18:04
zipR4ND has joined #crystal-lang
18:16
Raimondi has quit [Write error: Broken pipe]
18:18
Raimondi has joined #crystal-lang
18:30
Shad has quit [Quit: Page closed]
19:02
early has quit [Quit: Leaving]
19:05
early has joined #crystal-lang
19:31
_whitelogger has joined #crystal-lang
20:33
Dreamer3 has joined #crystal-lang
20:39
tzekid has joined #crystal-lang
21:03
bjz has joined #crystal-lang
21:30
marius has joined #crystal-lang
21:30
Raimondi has quit [Read error: Connection reset by peer]
21:31
Raimondi has joined #crystal-lang
21:32
zacts has quit [Quit: WeeChat 1.7.1]
22:03
tzekid has quit [Quit: tzekid]
22:08
<
FromGitter >
<bew> It's just me or the core team went on holiday? :D
22:25
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
22:35
bjz has joined #crystal-lang
22:36
bjz has quit [Client Quit]
22:38
bjz has joined #crystal-lang
22:38
bjz has quit [Client Quit]
22:41
<
FromGitter >
<elthariel> Salut @thbar :)
22:43
<
FromGitter >
<fridgerator> its been quiet lately
22:47
<
oprypin >
AAAAAAAAAAAAAAAAAAAAAAA
22:47
<
FromGitter >
<bew> BBBBBB?
22:48
<
oprypin >
no, that makes almost no sound
22:48
<
oprypin >
could try EEEEEEE
22:48
<
FromGitter >
<MatthewBennington> No, it's the sound a bee makes.
22:48
<
FromGitter >
<bew> u right, or IIIIII!
22:49
<
FromGitter >
<MatthewBennington> (I'm sorry)
22:49
<
FromGitter >
<bew> ^^
22:49
<
FromGitter >
<KCreate> Does anyone know if crystal includes a typeid into value types?
22:49
<
FromGitter >
<bew> yep
22:49
<
oprypin >
wait.. why are you saying that? I think it doesn't
22:50
<
oprypin >
it may include that in union value types
22:50
<
FromGitter >
<KCreate> I think it does in reference types, unions, abstract structs...
22:50
<
FromGitter >
<bew> u sure there is no type id in all types (instances or not)?
22:51
<
FromGitter >
<KCreate> nah that would be wasteful
22:51
<
FromGitter >
<KCreate> If the compiler knows that an instance variable is always Int32, it will encode it as Int32
22:52
<
FromGitter >
<bew> hmm, maybe only for class/struct/union then
22:54
<
RX14 >
not for struct
22:54
<
FromGitter >
<bew> not in structsapparently
22:54
<
RX14 >
union always
22:54
<
RX14 >
i'm not sure about class but i'm like
22:54
<
RX14 >
90% sure they always have type IDs
22:55
<
FromGitter >
<KCreate> classes always have the type id
22:55
<
FromGitter >
<KCreate> Even if there are now subclasses
22:55
<
FromGitter >
<KCreate> There's an example in the docs which shows that
22:55
<
FromGitter >
<KCreate> (In the docs about instance_sizeof)
22:59
dannyAAM has quit [Ping timeout: 260 seconds]
23:01
dannyAAM has joined #crystal-lang
23:05
oz has quit [Ping timeout: 258 seconds]
23:05
oz has joined #crystal-lang
23:28
jokke has quit [Quit: WeeChat 1.7]
23:33
jokke has joined #crystal-lang
23:36
Gacrux has joined #crystal-lang
23:36
txdv has quit [Ping timeout: 268 seconds]
23:38
Gacrux has left #crystal-lang ["Leaving"]
23:53
bjz has joined #crystal-lang
23:56
jokke has quit [Quit: WeeChat 1.7.1]
23:58
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]