<postmodern>
nice, just need to wire it up. suppose i could write a shard for winsize.
<FromGitter>
<kaukas_gitlab> > otherwise it seems to be because you're capturing the blocks, which need to have their input/output values/types defined beforehand as it turns the block into a proc ⏎ ⏎ Thank you for your answer! It does make a bit more sense now. Unfortunately, I am forced to rely on type inference because generics are buggy (https://github.com/crystal-lang/crystal/issues/10394)… And no, I can't just use
<FromGitter>
... `yield`; this example is strongly simplified. I feel stuck. :-(
_ht has joined #crystal-lang
<mps>
riffraff169: also I'm self taught in programming (and all computing) and I designed industrial computer (long ago) and some real time national wide parking services in two countries in europe
hendursa1 has joined #crystal-lang
hendursaga has quit [Ping timeout: 240 seconds]
<FromGitter>
<confact> How to split long numbers into 3 3 number ones in a good optimized way? like 191853 to 000, 191, 853
<FromGitter>
<MrSorcus> Does anyone have any openings in Crystal? X-)
postmodern has quit [Quit: Leaving]
<FromGitter>
<drum445> Hi Guys, if I wanted to get the properties of a Class and their types how would I go about this? ⏎ ⏎ ```Class User ⏎ property id : String ⏎ .... ⏎ end``` ⏎ ⏎ Then I would like something like {"id" => String} [https://gitter.im/crystal-lang/crystal?at=608fd834ff705616c76ce8b0]
<straight-shoota>
@confact: Assuming you're only working with integers, truncated division + remained is prob the best way to go
<FromGitter>
<alsoijw> Hello everyone. I want to create array using macros. I wrote this code
<FromGitter>
<alsoijw> Hello everyone. I want to create array using macros. I wrote this code ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I expect that it create array with tree elements, but it create with only last element. [https://gitter.im/crystal-lang/crystal?at=608fde280056b2262c2730a3]
<FromGitter>
<erdnaxeli:cervoi.se> I don't know exactly why it does that, but this works: https://carc.in/#/r/b21e
<FromGitter>
<erdnaxeli:cervoi.se> I have to declare `arr` outside of the macro, else it complains that it is not visible at top level
<FromGitter>
<erdnaxeli:cervoi.se> it is like the compiler is wrapping the macro code at top level in a method
<FromGitter>
<erdnaxeli:cervoi.se> no, it does the same in a method too
<FromGitter>
<alsoijw> > I don't know exactly why it does that, but this works: https://carc.in/#/r/b21e ⏎ ⏎ Thank you, it's solution.
<straight-shoota>
The explanation is correct, the result of a macro must be valid crystal code. You can just wrap the array literal itself in {%begin%}...{%end%}
<FromGitter>
<Blacksmoke16> @drum445 use `@type.instance_vars` in a method and use it to build out the hash
mps has quit [Ping timeout: 252 seconds]
<FromGitter>
<MrSorcus> Looks like no one does. :sad:
<FromGitter>
<oprypin:matrix.org> @ahcm: `case` is implemented as `===`, and `filenames == Array` is implemented as `filenames.is_a?(Array)`. however `typeof(filenames).is_a?(Array)` is false