<FromGitter>
<bararchy> It seems that there is general bikeshedding, where everyone want's the "perfect" solution while this is not addressed for more then two years now
<FromGitter>
<bararchy> and everyone just creates monky patching to handle this
<FromGitter>
<bew> @luislavena hey, just saw https://youtu.be/r_9UB8-hG7I who poped in my YouTube recommendations :) veryy nice! are you still in Paris?
ashirase has quit [Ping timeout: 272 seconds]
ashirase has joined #crystal-lang
blassin has quit [Remote host closed the connection]
blassin has joined #crystal-lang
<FromGitter>
<mavu> How do I check if I reached the end of an IO stream?
<FromGitter>
<j8r> The end? You can check of the IO is closed
<FromGitter>
<bew> Heart kind of io stream? (how would it know this is the end?)
<FromGitter>
<bew> What*
<FromGitter>
<j8r> Usually there is a terminator character
<FromGitter>
<j8r> For lines
<FromGitter>
<j8r> `\n` usually, that's it
<FromGitter>
<mavu> I just treid Process.run do |p| and in the block read p.output.
<FromGitter>
<mavu> it always runs into IO::EOFError
<FromGitter>
<mavu> even with while !p.closed? around.
<FromGitter>
<mavu> (btw: have not updated yet, still on 0.27.0)
<FromGitter>
<mavu> I think I know why that does not work. I suspect the pipe is only closed after the block exits. I just accideantally commented the puts p.output.read_line which left an empty block. ⏎ and the block never exited, with 100 cpu. I assume the while loop was circling the drain and .closed? never went true.
<FromGitter>
<proyb6> What is the Crystal equivalent of C++ std::vector?
_whitelogger has joined #crystal-lang
aelyx has joined #crystal-lang
aelyx has quit [Read error: Connection reset by peer]
<FromGitter>
<j8r> Yes it looks like C++ Array is StaticArray, and C++ Vector is Array
g- has quit [Remote host closed the connection]
<FromGitter>
<Sija> For y’all linting loving creatures, now you can use Ameba on Codacy! 🎉 Cheers to @veelenga for his work on that (both Ameba and Codacy integration) ❤️
jemc has joined #crystal-lang
<FromGitter>
<vladfaust> Thanks, @veelenga :)
<FromGitter>
<vladfaust> What's the best way to find difference between two flat Hash of the same type `String => T`?
<FromGitter>
<vladfaust> Having `@initial` and `@actual`, need to get changes in `@actual` compared to `@initial@
<FromGitter>
<Blacksmoke16> to compute a change set?
<FromGitter>
<vladfaust> Yup
<FromGitter>
<Blacksmoke16> new hash, iterate over each key of one, if they dont match add that new new hash?
<FromGitter>
<vladfaust> Yeah, but maybe a faster variant, IDK
<FromGitter>
<Blacksmoke16> intersect would be neat
<FromGitter>
<Sija> you’d have to override `HTTP::Cookie::Parser.parse_set_cookie`
<FromGitter>
<bararchy> 😢
<FromGitter>
<bararchy> f***ing M$
<FromGitter>
<Sija> that’s one of those rare cases where monkey-patching ain’t do it :/
<FromGitter>
<bararchy> yeha, interesting though wha'ts the idea of not allow overiding constants
<FromGitter>
<talbergs> Here is a small snippet. https://play.crystal-lang.org/#/r/67o1 Is it possible somehow to know a `callee` (at least class name) of a method? In lin 36 I have to pass `self` and in line 8 I have to accept it in signature. Could this value be determined runetime in def @line:8 ?
<FromGitter>
<Sija> @talbergs try `caller`
<FromGitter>
<talbergs> Thanks, will know about this keyword.
<FromGitter>
<Sija> you have a method names there too, but no class names indeed :/
<FromGitter>
<Sija> it used to include ‘em as well, but not anymoar
<FromGitter>
<talbergs> yes not anymoar :(
<FromGitter>
<talbergs> refactored a bit more https://play.crystal-lang.org/#/r/67oi now is there a `final` keyword? So ComponentA would not be able to declare method `get`
<FromGitter>
<Blacksmoke16> neg, could maybe do something like this tho
<FromGitter>
<talbergs> The first thing I guess is to create an expert level documentation for low level stuffs - ins and outs and various tricks - `caller` keyword for example is not in docs. Currently docs look like ment for housewifes, no offence
<FromGitter>
<talbergs> Could be separate gitbook thou. But really in depth. (and keep in mind, the reader never heard of ruby) ... my 2 cents ;)
<FromGitter>
<talbergs> Smart idea - metaprogramming for win
<FromGitter>
<talbergs> I have currently avoided metacoding in crystal - dunno syntax even
<FromGitter>
<talbergs> Do you ppl do it really often in your projects?
<FromGitter>
<talbergs> Does not it reduce readibility?
<FromGitter>
<Blacksmoke16> not to people who know crystal
<FromGitter>
<Blacksmoke16> macros are deff something that takes a bit getting used to for a new dev tho
gangstacat has quit [Quit: Ĝis!]
gangstacat has joined #crystal-lang
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 272 seconds]
<FromGitter>
<kingsleyh> Hahaha @talbergs - the docs look like they are meant for housewives - hahaha - awesome comment - so funny lol - not sure if it’s accuracy but very funny hehe
<FromGitter>
<Sija> had a proper laugh about it too, image of a housewife reading Crystal docs just next to the washing machine was a nice one :D
<FromGitter>
<sam0x17> aww that's too bad was hoping `Hash.each_with_index` would yield the key, the value, and the index ,but looks like just key and index
<FromGitter>
<HarrisonB> > the docs look like they are meant for housewives ⏎ ⏎ I think this may hurt fostering an inclusive atmosphere in this channel
return0e_ has quit [Ping timeout: 244 seconds]
<FromGitter>
<sam0x17> yeah guys lets keep things inclusive and unoffensive
<FromGitter>
<sam0x17> ah so the key and value are a tuple
<FromGitter>
<sam0x17> kk
<FromGitter>
<sam0x17> yes that works thanks
<FromGitter>
<Sija> @HarrisonB @sam0x17 c’mon guys, why so serious? ;) btw, imo these days it’s too easy to get into the trap of “inclusiveness” and forget about sense of humor
<FromGitter>
<Sija> soon we’ll need to put the rainbow flag over every project logo to get away from the accusations of not being exclusive, bit of distance won’t hurt...
<FromGitter>
<HarrisonB> @Sija personally it didn't strike me as very funny--I understand that may have been the intent but I imagine if you're a developer that also does housework it would feel kind of crummy to hear ⏎ ⏎ > soon we’ll need to put the rainbow flag over every project logo to get away from the accusations of not being exclusive ⏎ ⏎ I think that's a bit of a slippery slope argument...