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
hightower2 has quit [*.net *.split]
notzmv has quit [*.net *.split]
yxhuvud has quit [*.net *.split]
ua_ has quit [*.net *.split]
void09 has quit [*.net *.split]
olbat has quit [*.net *.split]
olbat has joined #crystal-lang
ua_ has joined #crystal-lang
olbat has quit [Changing host]
olbat has joined #crystal-lang
notzmv has joined #crystal-lang
yxhuvud has joined #crystal-lang
hightower2 has joined #crystal-lang
void09 has joined #crystal-lang
notzmv has quit [Ping timeout: 244 seconds]
notzmv has joined #crystal-lang
_ht has joined #crystal-lang
SamantazFox has joined #crystal-lang
_ht has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 244 seconds]
ur5us has joined #crystal-lang
wolfshappen has quit [Ping timeout: 248 seconds]
wolfshappen has joined #crystal-lang
wolfshappen has quit [Client Quit]
wolfshappen has joined #crystal-lang
ur5us has quit [Ping timeout: 255 seconds]
raph_ael has joined #crystal-lang
<raph_ael> hi
human_g33k has quit [Ping timeout: 248 seconds]
Vexatos has quit [Quit: Client Quit]
Stephie- has quit [Quit: Fuck this shit, I'm out!]
Stephie has joined #crystal-lang
Vexatos has joined #crystal-lang
jmdaemon has quit [Ping timeout: 268 seconds]
human_g33k has joined #crystal-lang
<FromGitter> <Blacksmoke16> o/
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 252 seconds]
<FromGitter> <RespiteSage> Is there an easy way to determine if a `File` is at end-of-file?
<FromGitter> <Blacksmoke16> `file.peek.try &.empty?`?
<FromGitter> <RespiteSage> I'm deserializing a binary file that has a header and an unknown number of records (it's gridded, but some points may be missing).
<FromGitter> <RespiteSage> Yeah, that's probably the way to go. It's just weird that there's nothing clearer.
<FromGitter> <Blacksmoke16> or do something with `.pos`
<FromGitter> <Blacksmoke16> like if `file.pos == size_of_file` or something like that?
<FromGitter> <RespiteSage> Yeah, that was the other thing I was thinking. I think I'll go with the first one in case we ever decide on a way to send this data over a network (though we'll of course have to wrap it in something that can receive information about whether it's received everything).
<FromGitter> <RespiteSage> I'm checking issues to see if there's a reason why we don't have `File#eof?`.
<FromGitter> <RespiteSage> It seems like the answer is basically "it's inconsistent due to race conditions"
<FromGitter> <RespiteSage> @Blacksmoke16 Thanks for labelling it. :)
<FromGitter> <Blacksmoke16> 👍
_ht has joined #crystal-lang
<raph_ael> is there a working shell in crystal, like xonsh in python, that can help trying it on daily basis and scripting ? thanks
<FromGitter> <Blacksmoke16> https://crystal-lang.org/2021/12/29/crystal-i.html would prob be your best bet
<FromGitter> <RespiteSage> Is there a better way to get a `Slice(T)` from an `Array(T)` than `arr.to_unsafe.to_slice(arr.size)`?
notzmv has quit [Ping timeout: 268 seconds]
<riza> not that i've found
<FromGitter> <RespiteSage> Good to know. Thanks!
jmdaemon has joined #crystal-lang
notzmv has joined #crystal-lang
<FromGitter> <RespiteSage> You can't do `typeof(non_constant_variable)` at compile-time, right?
_ht has quit [Remote host closed the connection]
<FromGitter> <Blacksmoke16> like in a macro?
ur5us has joined #crystal-lang
<FromGitter> <RespiteSage> Yeah, that's what I was thinking. But I thought that macros are evaluated too early.
<FromGitter> <Blacksmoke16> Either way, typeof doesn't work in macros
<FromGitter> <RespiteSage> Gotcha. Thanks!
Sankalp- has joined #crystal-lang
Sankalp has quit [Ping timeout: 268 seconds]
Sankalp- is now known as Sankalp