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
lanodan has quit [Ping timeout: 264 seconds]
lanodan has joined #crystal-lang
quazimodo has joined #crystal-lang
<FromGitter> <wwalker> Hey I had that written down to report!
ur5us has quit [Ping timeout: 252 seconds]
alexherbo2 has joined #crystal-lang
quazimodo has quit [Ping timeout: 248 seconds]
quazimodo has joined #crystal-lang
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #crystal-lang
taupiqueur has quit [Ping timeout: 264 seconds]
taupiqueur has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 260 seconds]
taupiqueur has quit [Ping timeout: 260 seconds]
taupiqueur has joined #crystal-lang
alexherbo2 has joined #crystal-lang
ur5us has joined #crystal-lang
taupiqueur has quit [Remote host closed the connection]
taupiqueur has joined #crystal-lang
taupiqueur has quit [Remote host closed the connection]
taupiqueur has joined #crystal-lang
alexherbo2 has quit [Remote host closed the connection]
taupiqueur has quit [Ping timeout: 252 seconds]
taupiqueur has joined #crystal-lang
alexherbo2 has joined #crystal-lang
taupiqueur has quit [Ping timeout: 252 seconds]
taupiqueur has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #crystal-lang
taupiqueur has quit [Ping timeout: 252 seconds]
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #crystal-lang
ur5us has quit [Ping timeout: 260 seconds]
fifr` has quit [Ping timeout: 248 seconds]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 260 seconds]
fifr` has joined #crystal-lang
alexherbo2 has joined #crystal-lang
taupiqueur has joined #crystal-lang
Sankalp has quit [Ping timeout: 252 seconds]
Sankalp has joined #crystal-lang
alexherbo2 has quit [Remote host closed the connection]
jmdaemon has quit [Ping timeout: 252 seconds]
quazimodo has quit [Ping timeout: 260 seconds]
hightower3 has quit [Ping timeout: 252 seconds]
Sankalp has quit [Ping timeout: 260 seconds]
_ht has joined #crystal-lang
Sankalp has joined #crystal-lang
_ht has quit [Remote host closed the connection]
Sankalp has quit [Ping timeout: 252 seconds]
_ht has joined #crystal-lang
Sankalp has joined #crystal-lang
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Remote host closed the connection]
_ht has quit [Read error: Connection reset by peer]
ht_ has joined #crystal-lang
ht_ is now known as _ht
jmdaemon has joined #crystal-lang
_ht has quit [Quit: _ht]
ht_ has joined #crystal-lang
fifr is now known as Guest6184
Guest6184 has quit [Killed (cadmium.libera.chat (Nickname regained by services))]
fifr` is now known as fifr
fifr_ has joined #crystal-lang
ht_ is now known as _ht
ht_ has joined #crystal-lang
_ht has quit [Read error: Connection reset by peer]
ht_ is now known as _ht
_ht has quit [Read error: Connection reset by peer]
_ht has joined #crystal-lang
ur5us has joined #crystal-lang
Ober has joined #crystal-lang
_ht has quit [Read error: Connection reset by peer]
<SamantazFox> Hi! I'm coming with yet another weird question: why does my subclass don't have the property defined in its parent? https://play.crystal-lang.org/#/r/ehpj
<SamantazFox> It looks like it's because of the `finalized` macro, but without it, my various initialize functions aren't recognized (I get: "there is no previous definition of 'initialize'") https://bpa.st/SFSFM
<FromGitter> <Blacksmoke16> if i had to guess you are correct
<FromGitter> <Blacksmoke16> property is never actually added
<FromGitter> <Blacksmoke16> what is your expectation here?
<FromGitter> <Blacksmoke16> imo feels like a major code smell to call `previous_def` in an initialize method
<SamantazFox> How can I write it in a way where all my variables are properly initialized, and I don't have to rewrite 20 times the same code?
<FromGitter> <Blacksmoke16> hmm
<SamantazFox> My other idea was to declare a function for each trait, and do a bunch of `if self.responds_to?` in the initialize method, but iirc I encountered some nasty problems, and imho that looks terrible :/
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=63d993660c94855213da4194]
<FromGitter> <Blacksmoke16> better visual on the hierarchy
ur5us has quit [Read error: Connection reset by peer]
<FromGitter> <Blacksmoke16> i feel like some sort of builder type would make the most sense here
ur5us has joined #crystal-lang
<FromGitter> <Blacksmoke16> like that accepts the `format` JSON, consumes it all, storing all the data internally as if it was an instance of every module, then a final `#build` method that returns the proper instance, using its internal state as arguments to that type's constructor
<FromGitter> <Blacksmoke16> you have some example input for this thing?
<SamantazFox> What did you do to get that hierarchy? You used the crystal compiler tools?
<SamantazFox> (making a list of inputs, hold on)
<FromGitter> <Blacksmoke16> `crystal tool hierarchy test.cr`
<FromGitter> <Blacksmoke16> but replaced all the modules with a bool property named after the module just as added visual
quazimodo has joined #crystal-lang
<SamantazFox> ah hmmm, ok!
<SamantazFox> Here is the list: https://bpa.st/KG7PK
<SamantazFox> each JSON object starting with "itag" is one of the possible inputs of `parse_adaptative_formats`
<SamantazFox> (there are another handful of variants that I haven't included)
<FromGitter> <Blacksmoke16> okay, instead of the builder i think this is a case where id just accept some duplicate code and dont bother with the modules and stuff. doesnt seem to be a great solution
<FromGitter> <Blacksmoke16> other catch is there is no indirect initialization
<FromGitter> <Blacksmoke16> sec, let me get an example together
<SamantazFox> thing is I don't want to have like 7 or more times the same code with minor variations. This is going to be a nightmare to maintain...
<mps> Blacksmoke16: last night my son looked at athena (he works in this field) and he told me that it is really good framework, something about he thought to make
<FromGitter> <Blacksmoke16> @SamantazFox let me play with this more and ill ping you later
<SamantazFox> Ok, sure!
<SamantazFox> I might not respond, thoug, as it's already quite late in here, but I always have my client open
<FromGitter> <Blacksmoke16> @mps glad to hear! still plenty more that can be added/improved, but its getting there 💪
<mps> I skimmed over athena about two years ago (iirc) but as I don't work in this field I didn't understood much, but he explained to me how it is good for something he had in his had
<mps> but I remember your deep knowledge and understanding of things following this channel
<FromGitter> <Blacksmoke16> deff has evolved a lot in last 2 years
<FromGitter> <Blacksmoke16> some of the patterns and such aren't really common to Ruby world either, so it does require some understanding of the *why* it does things the way it does
<mps> I don't understand and it doesn't matter because I don't have plan to work with, just wanted to tell that my son appreciate your work
<FromGitter> <Blacksmoke16> thanks man, i appreciate it 😊
<mps> thank you for such good work
oprypin has quit [Quit: Bye]
oprypin has joined #crystal-lang
<FromGitter> <Blacksmoke16> @SamantazFox is that valid JSON?
<FromGitter> <Blacksmoke16> nvm
<FromGitter> <Blacksmoke16> @SamantazFox this is what i came up with: https://play.crystal-lang.org/#/r/ehqn ⏎ ⏎ Basically makes each module define a macro to parse the data, manually defines the constructors, and call the helper macro. overall a lot simpler and still keep your helper modules
<FromGitter> <Blacksmoke16> might have to play with the parsing macros to make it actually work but should be a good start
jmdaemon has quit [Ping timeout: 248 seconds]