ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
<FromGitter> <riffraff169> generally speaking, an object shouldnt care who uses it, so knowing which caller would not be appropriate i think
Nekka has joined #crystal-lang
<FromGitter> <riffraff169> not that this is functional programming, but if a function/method returns different results depending on who is calling it, that would be like the opposite
FromGitter has quit [Ping timeout: 276 seconds]
oprypin has quit [Ping timeout: 276 seconds]
oprypin has joined #crystal-lang
FromGitter has joined #crystal-lang
oddp has quit [Quit: quit]
FromGitter has quit [Ping timeout: 276 seconds]
oprypin has quit [Ping timeout: 276 seconds]
oprypin has joined #crystal-lang
FromGitter has joined #crystal-lang
aquijoule__ has joined #crystal-lang
aquijoule_ has quit [Ping timeout: 246 seconds]
duane has quit [Ping timeout: 265 seconds]
<FromGitter> <emanzx> I check it out.. quite good.. but does it able to work with other languages? like ruby on rails? we have large part of our apps still on ruby on rails.
<FromGitter> <Blacksmoke16> mm i doubt it given it uses redis as the store
_ht has joined #crystal-lang
aquijoule__ has quit [Remote host closed the connection]
hendursa1 has joined #crystal-lang
hendursaga has quit [Ping timeout: 240 seconds]
duane has joined #crystal-lang
deavmi_ has joined #crystal-lang
deavmi has quit [Read error: Connection reset by peer]
ua_ has quit [Ping timeout: 240 seconds]
ua_ has joined #crystal-lang
HumanG33k has quit [Quit: Leaving]
<FromGitter> <MrSorcus> https://gist.github.com/MrSorcus/a01f0508ed5d311541465860d88b2b79 - how should i call `example` method with `array of string`?
<straight-shoota> Your C implementation looks strange
<straight-shoota> that's not how you handle strings in C nor in Crystal
<FromGitter> <MrSorcus> @straight-shoota 😆
<straight-shoota> either you treat the data as Crystal strings with size field, or you treat them as null-terminated C strings
<straight-shoota> for the latter you need a conversion on Crystal side
<straight-shoota> for both you need to fix the C code
<FromGitter> <MrSorcus> @straight-shoota https://gitlab.nic.cz/knot/knot-dns/-/blob/master/src/libknot/control/control.c#L386 - this is the function, i actually tried to bind.
<straight-shoota> no idea what that does, but at least it seems to operate on fixed-size data types
<straight-shoota> you should be able to pass in a pointer to the first knot_ctl_t value
<straight-shoota> staticarray, array, slice should all produce valid pointers for that
<straight-shoota> but the end of the list needs to be signaled by a null value
<straight-shoota> or actually, it's not the end
<straight-shoota> you need KNOT_CTL_IDX__COUNT items
<FromGitter> <MrSorcus> `KNOT_CTL_IDX__COUNT` is just a number of strings. 12 actually.
<straight-shoota> yeah you need as many array items
<FromGitter> <MrSorcus> Yeah, but why in my reduced example i can't get value from data, if it's `StaticArray`?
<straight-shoota> your reduced example is completely messed up because it uses strings
<straight-shoota> try it with a struct, or number
<FromGitter> <MrSorcus> You mean `StaticArray["Hello", ...]`?
<straight-shoota> the C code does not work
<FromGitter> <MrSorcus> Hmm...
f1refly has quit [Ping timeout: 252 seconds]
<FromGitter> <MrSorcus> Well, i forgot to change `printf("Value: %s\n", data[i]);` to `printf("Value: %s\n", value);`, but it still don't work.
<straight-shoota> I already told you why it doesn't work
<FromGitter> <MrSorcus> ```code paste, see link``` ⏎ ⏎ But this code works and it prints all values correctly... [https://gitter.im/crystal-lang/crystal?at=60958e1298ee821821b5dbca]
<FromGitter> <MrSorcus> @straight-shoota ok, i must reread your messages. X-)
f1refly has joined #crystal-lang
Xeago has quit [Quit: Xeago]
Xeago has joined #crystal-lang
Xeago has quit [Quit: Xeago]
Xeago has joined #crystal-lang
Xeago has quit [Excess Flood]
Xeago has joined #crystal-lang
_ht has quit [Remote host closed the connection]
ua_ has quit [Quit: Leaving]
ua has joined #crystal-lang
postmodern has joined #crystal-lang