ChanServ changed the topic of #crystal-lang to: The Crystal programming language | | Fund Crystal's development: | GH: | Docs: | Gitter:
ua_ has quit [Excess Flood]
ua_ has joined #crystal-lang
notzmv has quit [Ping timeout: 256 seconds]
notzmv has joined #crystal-lang
ur5us_ has quit [Ping timeout: 272 seconds]
waleee has quit [Ping timeout: 250 seconds]
ur5us_ has joined #crystal-lang
oz has quit [*.net *.split]
ua_ has quit [*.net *.split]
ejjfunky has quit [*.net *.split]
wolfshappen has quit [*.net *.split]
Flipez has quit [*.net *.split]
Stephie has quit [*.net *.split]
ox has joined #crystal-lang
ua_ has joined #crystal-lang
wolfshappen has joined #crystal-lang
ejjfunky has joined #crystal-lang
Stephie has joined #crystal-lang
Flipez has joined #crystal-lang
dom96 has quit [*.net *.split]
dom96 has joined #crystal-lang
ur5us_ has quit [Ping timeout: 240 seconds]
ur5us_ has joined #crystal-lang
ur5us_ has quit [Ping timeout: 240 seconds]
taupiqueur has joined #crystal-lang
taupiqueur has quit [Client Quit]
waleee has joined #crystal-lang
waleee has quit [Ping timeout: 272 seconds]
dannyAAM has quit [Quit: : ZNC 1.6.2 -]
dannyAAM has joined #crystal-lang
ur5us_ has joined #crystal-lang
ur5us_ has quit [Remote host closed the connection]
ur5us_ has joined #crystal-lang
waleee has joined #crystal-lang
SamantazFox has joined #crystal-lang
<SamantazFox> I, uhhhh
<SamantazFox> Am I missing something?
<FromGitter> <Blacksmoke16> you're monkey patching a built in type
<SamantazFox> OH, crap
<SamantazFox> Thanks!
<FromGitter> <tenebrousedge> o7 @Blacksmoke16
<FromGitter> <Blacksmoke16> o/
<SamantazFox> Welp, renaming didn't change anything
<SamantazFox> I'm still getting the same error
<FromGitter> <Blacksmoke16> you sure?
<SamantazFox> whaaat
<SamantazFox> (and it doesn't even complain about missing globals, dafuq)
<FromGitter> <Blacksmoke16> reminder if a method isn't used, its removed from the binary
<FromGitter> <Blacksmoke16> which is why testing is so helpful, even in a compiled lang
<FromGitter> <Blacksmoke16> at least in the context of Crystal*
<SamantazFox> I honnestly like Crystal, but it's sometimes making me run crazy
<FromGitter> <Blacksmoke16> 😅
<SamantazFox> atm, I'm trying to solve an issue that happens only on Crystal 1.3.x
<FromGitter> <Blacksmoke16> oh?
<SamantazFox> There was some chunking code that worked fine since forever, and 1.3.0 broke that
<SamantazFox> (yeah, sorry if the code isn't clean, it was written back when Crystal 0.3x was still a thing.
<SamantazFox> I've read the whole changelog, looked at most PRs listed here, and I can't find what broke that damned code
<FromGitter> <Blacksmoke16> wouldnt thinks break out of the inner most block, resulting in it to do another iteration since its in `while true`
<FromGitter> <Blacksmoke16> wouldnt this*
<SamantazFox> `break` only applies to `while`, `each` and other enumerable blocks, no?
<FromGitter> <Blacksmoke16> I'm *pretty* sure it would break out of the `client.get` block
<FromGitter> <Blacksmoke16> but not the `while` loop
<SamantazFox> ahhhhh, why
<FromGitter> <Blacksmoke16> ⏎ ⏎ ```Iterating ⏎ 301 ⏎ Iterating ⏎ 301``` []
<SamantazFox> Also, managed to reproduce (as you said, size method was removed, so I had to use it)
<FromGitter> <Blacksmoke16> so since its in a block, it breaks from that, and not the while loop
<FromGitter> <Blacksmoke16> in PHP you can do like `break 2;` but Crystal doesnt support that syntax, so would be better off refactoring your code to make use of `return` instead, or have `break` return a value you check for and `break` again
<SamantazFox> haaaaaaaa *flails*
<SamantazFox> And I guess this has been a side effect of some fix, somewhere
<FromGitter> <Blacksmoke16> not sure, would have to bisect it
<FromGitter> <Blacksmoke16> but afaik its been like that for a while, so might just be a red herring
ur5us_ has quit [Ping timeout: 240 seconds]
<SamantazFox> "for a while" the code was made in 2018 and hasn't been touched since then :B
<FromGitter> <Blacksmoke16> try and reduce the bug
<SamantazFox> tbh, I won't bother much. I'm already refactoring
<FromGitter> <Blacksmoke16> same output on both versions, so prob isnt directly related to `break` or something
<FromGitter> <Blacksmoke16> whats the point of `BytesRange`?
<SamantazFox> parse, store, and analyse a `Range` header
<SamantazFox> (`Range` being already taken, I went with that)
<SamantazFox> This is because we need to manually chunk the data to bypass rate limitation. So we can't just forwad queries from client to the server on the other side.
<FromGitter> <Blacksmoke16> ah, thats annoying
<SamantazFox> yeaaaaah xD
<SamantazFox> and idk why in heck the compiler doesn't want to accept the `if` as a guard against doing `nil-int`
ur5us_ has joined #crystal-lang
<SamantazFox> Told ya that this language was making me crazy xD
<FromGitter> <> i wonder if the copying could be done automagically when doing `if @foo`. would save some boilerplate code.
<FromGitter> <Blacksmoke16> Be more complex than just doing it yourself
<FromGitter> <> i don't mind complex as long i don't see it and don't have to think about it :p
<FromGitter> <> even if it costs a bit of performance i'd default to "safe access" since that's probably the intent in 9/10 cases. and perhaps add a special syntax for "unsafe access". but yea, haven't fully thought it through - maybe there are cases where the intent is ambiguous.
<FromGitter> <Blacksmoke16> All the tools to do that already exist
<FromGitter> <Blacksmoke16> I don't see it changing
<FromGitter> <Blacksmoke16> Also not_nil and try methods are a thing
<FromGitter> <Blacksmoke16> not_nil! Rather
<FromGitter> <> “The computer should be doing the hard work. That’s what it’s paid to do, after all.”
<FromGitter> <> i think the question is, when you write `if @foo` - is there ever a case where you'd want to allow it to change under your feet afterwards?
<FromGitter> <Blacksmoke16> no, which is why it doesnt affect typing at all
<FromGitter> <> so why force everyone to write `if foo = @foo` then ¯\_(ツ)_/¯
<FromGitter> <Blacksmoke16> because they're semantically different
<FromGitter> <Blacksmoke16> the former is an instance var while the latter is a local var
<FromGitter> <> yup but it seems one of the two semantics has no use-case
<FromGitter> <Blacksmoke16> could just outright forbidding `if @foo` but that might be tricky given `if @foo.nil?` is still valid and such
<FromGitter> <> and that's the default semantic
<FromGitter> <Blacksmoke16> could see*
<FromGitter> <> yup, getting it right would probably be tricky for sure. i don't really see it happening either. but a man can dream.
<FromGitter> <Blacksmoke16> technically its still a valid conditional, that just doesnt reduce typing
<FromGitter> <Blacksmoke16> so its really only invalid in certain cases
Peter0x44 has quit [Ping timeout: 240 seconds]
Peter0x44 has joined #crystal-lang