<FromGitter>
<andrewc910> Where is the `=` in the first example?
<FromGitter>
<andrewc910> Whaaaaat
<FromGitter>
<tenebrousedge> strange
<FromGitter>
<andrewc910> I imagine '=' represents something other than what I am seeing.
<FromGitter>
<stronny> it's just a character
<FromGitter>
<stronny> ruby's String#split behaves different from Crystal's
<FromGitter>
<tenebrousedge> I get `["1", ""]` for `"1=".split '='`
<FromGitter>
<andrewc910> But idk why string#spkit behaves differently depending on the char. I don't believe split is aware if the string can be an integer.
<FromGitter>
<tenebrousedge> oh, Ruby though
<FromGitter>
<stronny> I though the IRB prompt would be visible enough, eh
<FromGitter>
<stronny> I'll edit those
<FromGitter>
<tenebrousedge> what's `irb`? `pry` for life
<FromGitter>
<tenebrousedge> although I understand 2.7 brings those two much closer
<FromGitter>
<fenicks> I read about free variables in Crystal documentstion but didn't understand the forall keyword meaning. I appreciate if you have lecture link or explanation.
<FromGitter>
<stronny> basically you define a macro method that would not only work with any type, but you would also have that type in the T macro var
<FromGitter>
<Acciaiodigitale> I know only @faustinoaq that is no more actively following his excellent project like the VSCode plugin
<FromGitter>
<Acciaiodigitale> I want to help
_whitelogger has joined #crystal-lang
dwdv has joined #crystal-lang
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Quit: Saliendo]
<postmodern>
do Pointer(...).malloc pointers get LibC.free'd when GC collects them?
ua has quit [Ping timeout: 258 seconds]
ua has joined #crystal-lang
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Remote host closed the connection]
<FromGitter>
<asterite> yes and no
<FromGitter>
<asterite> they don't go through libc
<FromGitter>
<asterite> they essentially do gc_malloc
<FromGitter>
<asterite> so they are tracked by the gc
<FromGitter>
<asterite> undead robot: the split difference is intentional
<FromGitter>
<asterite> there's remove_empty option in Crystal which is false by default
<FromGitter>
<asterite> the default in Crystal is so when you join the result you get the initial string
<FromGitter>
<stronny> yes, I've read the rationale thanks
<FromGitter>
<stronny> I guess my complaint is that it's somewhat inconvenient to do `a,b=str.split(sep, 2)` that would raise if there is no sep in str.
<oprypin>
so is that bad? i dont get it
<FromGitter>
<stronny> I think would rather deal with nil there
<FromGitter>
<tenebrousedge> use a regex and capture groups then?
<FromGitter>
<stronny> why?
<FromGitter>
<tenebrousedge> because then you're matching what you want rather than what you don't want
<FromGitter>
<stronny> I would like a method like `fix_split(sep, size) : Array(String)` that would return an array with a fixed size == `size`
<FromGitter>
<stronny> or even `: StaticArray(String, size)` though I'm not sure compiler would understand
<FromGitter>
<stronny> just a thought though, I'm not advocating for stdlib expansion here
<FromGitter>
<drum445> @Blacksmoke16 how do you enable sessions in Athena?
olbat has joined #crystal-lang
<FromGitter>
<asterite> there's partition too
<FromGitter>
<stronny> oh, that's right
_whitelogger has joined #crystal-lang
<FromGitter>
<stronny> or at least do something like `{{ find_class(MyClass) }}` ?
<FromGitter>
<Blacksmoke16> what would it return?
<FromGitter>
<stronny> TypeNode
<FromGitter>
<Blacksmoke16> @drum445 what are you trying to do exactly? There's currently not anything built in for that, but probably be pretty trivial to create depending on your use case
<FromGitter>
<stronny> I think you can do that from a macro in Object and recursive #subclasses search, but it doesn't look clean