<FromGitter>
<yorci> @jhass that looks what i want to do, thank you
DeBot has joined #crystal-lang
<FromGitter>
<Blacksmoke16> is it a bug protected defs dont show up in api docs when defined in modules?
<FromGitter>
<Blacksmoke16> I could see private methods being excluded since they are most often used internally, but protected methods should prob be documented as children could override them
<FromGitter>
<Blacksmoke16> thoughts? ^
<FromGitter>
<dscottboggs_gitlab> > protected methods should prob be documented as children could override them ⏎ ⏎ 👍
<alexherbo21>
What is the Crystal equivalent to unpack a message length as 4 byte integer
<alexherbo21>
in Ruby, I’ve do: text_length = text_length_bytes.unpack('i').first
<alexherbo21>
I read the message length (first 4 bytes) from stdin with STDIN.gets(4)
<alexherbo21>
for example, if I have a string length of '{"test":"ok"}' (.lenght == 12), how to write it to stdout as 32-bit message length in native byte order
<alexherbo21>
hm, length is not the good method with utf8 character no?
<jhass>
they don't say very explicitly but I guess they mean byte count, yeah
<jhass>
so STDOUT.write_bytes(string.bytesize); STDOUT.write(string)
<jhass>
eh, STDOUT << string I mean
<alexherbo21>
and for receiving: length = STDIN.read_bytes(4); message = STDIN.read_bytes(length)?
alexherbo2137 has quit [Ping timeout: 268 seconds]
<alexherbo21372>
command = ["echo", "tchou", "tchou"]; system(*command) how to do that in Crystal with the splat?
<FromGitter>
<Blacksmoke16> Replace the brackets with curly braces, then you could splat
<FromGitter>
<Blacksmoke16> Can't splat an array
<alexherbo21372>
the command comes from JSON
<alexherbo21372>
so I can’t I guess
<FromGitter>
<j8r> you still can
<FromGitter>
<j8r> but you'll need to use a case/when
<FromGitter>
<j8r> and support X number of elements
<FromGitter>
<mistergibson> Anyone have a link to some intermediate-to-advanced use of fibers and channels. The basic docs get you started, but I could use more research on the topic. Thanks in advance.
<FromGitter>
<Blacksmoke16> https://github.com/Blacksmoke16/crylog/tree/develop/docs been working on a logging framework based on one we use at work. if anyone wants to glance thru the docs and give thoughts/suggestions while its still young
<alexherbo21372>
I can't figure out Array(String).from_json(request) to call with system
<alexherbo21372>
I have an array of strings and want to call sytem(...array)
<FromGitter>
<Blacksmoke16> you cant splat an array
<FromGitter>
<Blacksmoke16> so prob have to go to plan b
<FromGitter>
<Blacksmoke16> is the number of elements known, or could the request return diff size arrays?
<alexherbo21372>
the number of elements is not known in advance