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
ukd1 has quit [Quit: leaving]
eax has joined #crystal-lang
<eax> is there a Vector type in Crystal?
<FromGitter> <Blacksmoke16> Not in the stdlib at least
andremedeiros has quit [Quit: ZNC 1.8.2 - https://znc.in]
andremedeiros has joined #crystal-lang
aquijoule_ has joined #crystal-lang
richbridger has quit [Ping timeout: 240 seconds]
eax has quit [Ping timeout: 268 seconds]
_whitelogger has joined #crystal-lang
chachasmooth has quit [Ping timeout: 264 seconds]
chachasmooth has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <grkek> Hello
_ht has joined #crystal-lang
<FromGitter> <naqvis> eax Array in Crystal is equivalent to Vector in other languages
<FromGitter> <naqvis> Array dynamically grows when needed
<FromGitter> <grkek> I think he meant something like a 3D vector?
<FromGitter> <naqvis> then just ignore my message 😄
oprypin_ is now known as oprypin
eax has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> hi
eax has quit [Ping timeout: 268 seconds]
eax has joined #crystal-lang
eax has quit [Remote host closed the connection]
<FromGitter> <erdnaxeli:cervoi.se> hi, is there a way to fix this: https://carc.in/#/r/ag3z ?
<FromGitter> <erdnaxeli:cervoi.se> if I include JSON::Serializable in J then it complains it is abstract (understandable). https://carc.in/#/r/ag42
<FromGitter> <erdnaxeli:cervoi.se> and if I remove the abstract it give me a `J` object, which I don't want
<FromGitter> <erdnaxeli:cervoi.se> I can try to work my hierarchy of types in another way too, but if somebody sees a quickwin to fix this code, it would be very appreciated :)
<FromGitter> <Blacksmoke16> You'd probably want to use a discriminator in this case
<FromGitter> <jrei:matrix.org> I tried with crystalizer, got a weird result: https://carc.in/#/r/ag4c
<FromGitter> <jrei:matrix.org> normal? And how to have `[A, B]` instead of `[J]`
<FromGitter> <asterite> Of course it's normal, a union of types under a parent type is the parent type
<FromGitter> <erdnaxeli:cervoi.se> hmm I can understand the logic but that's not the behavior I expect
<FromGitter> <erdnaxeli:cervoi.se> maybe I will write my own macro that try every union's type
<FromGitter> <erdnaxeli:cervoi.se> I expect => I want here
<FromGitter> <jrei:matrix.org> using composition works
<FromGitter> <erdnaxeli:cervoi.se> Composition?
<FromGitter> <jrei:matrix.org> yes, `module j; end`, then in your type, `include J`
<FromGitter> <erdnaxeli:cervoi.se> Ok, good to know
<FromGitter> <jrei:matrix.org> the term could be mentioned in https://crystal-lang.org/reference/syntax_and_semantics/modules.html
<FromGitter> <erdnaxeli:cervoi.se> I feel like the composition explained in Wikipedia is not exactly the same composition with module inclusion
<FromGitter> <jrei:matrix.org> the result is more or less the same
teardown has quit [Ping timeout: 268 seconds]
<FromGitter> <jrei:matrix.org> instead of having a inheritance hierarchy, you have reusable blocks
<FromGitter> <erdnaxeli:cervoi.se> Yep
_whitelogger has joined #crystal-lang
<FromGitter> <jrei:matrix.org> module can also be used in place of interfaces
<FromGitter> <jrei:matrix.org> not exactly the same as other languages, but do the job fine
teardown has joined #crystal-lang
teardown has quit [Remote host closed the connection]
teardown has joined #crystal-lang
teardown has quit [Remote host closed the connection]
teardown has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Read error: Connection reset by peer]
_ht has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
<sorcus> Hi, guys.
<sorcus> https://play.crystal-lang.org/#/r/ag51 - did i missed something?
<FromGitter> <Blacksmoke16> = nil
<FromGitter> <Blacksmoke16> Otherwise it's required, just nilable
<sorcus> Blacksmoke16: Oh, thanks, i thought just `Type?` always worked... X-)