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
ur5us has quit [Ping timeout: 248 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 250 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 264 seconds]
<FromGitter> <spuun> Macro issue. Dunno if it's a bug or if I'm doing something wrong. ⏎ https://play.crystal-lang.org/#/r/duam
<FromGitter> <erdnaxeli:cervoi.se> the macro is not the issue: https://play.crystal-lang.org/#/r/duan
<FromGitter> <erdnaxeli:cervoi.se> well, yes it is
<FromGitter> <erdnaxeli:cervoi.se> it looks like the `::` in front of `Log` are removed from the type in the ivar
ur5us has joined #crystal-lang
<FromGitter> <spuun> Yeah.
<FromGitter> <spuun> And dunno if i can get around it? Maybe i must get the type vars and add the `::`? hm
<FromGitter> <spuun> https://play.crystal-lang.org/#/r/duap ⏎ Works.
walez__ has joined #crystal-lang
<jrayhawk> https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.json I was thinking of macroing a protocol spec into crystal object definitions; are there good examples available of how to go about doing so?
ur5us has quit [Ping timeout: 248 seconds]
ur5us has joined #crystal-lang
jmdaemon has quit [Ping timeout: 250 seconds]
walez___ has joined #crystal-lang
walez__ has quit [Read error: Connection reset by peer]
walez__ has joined #crystal-lang
walez___ has quit [Ping timeout: 265 seconds]
ur5us has quit [Ping timeout: 248 seconds]
walez__ has quit [Read error: Connection reset by peer]
walez__ has joined #crystal-lang
Sankalp has quit [Ping timeout: 244 seconds]
Sankalp has joined #crystal-lang
<FromGitter> <moe:busyloop.net> hmm in this ancient codebase (0.34) i have a `rescue ex : Errno`. ⏎ anyone remember what this was replaced with in current crystal? 🤔
<FromGitter> <moe:busyloop.net> (apparently TCPSocket used to raise it)
<FromGitter> <spuun> `typeof({{ivar}}).new` even better!
<FromGitter> <moe:busyloop.net> > anyone remember what this was replaced with in current crystal? 🤔 ⏎ ⏎ aha, `Socket::Error` it seems. ⏎ that took a bit more digging than it should - crystal needs a better way to discover what exceptions can bubble up from where </mini-rant> [https://gitter.im/crystal-lang/crystal?at=633acef834982518bddf8a21]
walez__ has quit [Quit: Leaving]
walez__ has joined #crystal-lang
walez__ has quit [Quit: Leaving]
walez__ has joined #crystal-lang
<FromGitter> <moe:busyloop.net> and another question: ⏎ are there any working docker images around to compile to amd64 on an m1 mac? ⏎ ⏎ the official images have been broken on m1 for a long time ⏎ and now the 84codes images that used to work as a workaround ... [https://gitter.im/crystal-lang/crystal?at=633aefd92a06f4566b1c1f12]
<FromGitter> <djberg96> Does crystal have something that deals with this issue in Ruby? https://bugs.ruby-lang.org/issues/19024
<FromGitter> <Blacksmoke16> not that i can think of
<FromGitter> <Blacksmoke16> usually you'd have diff entrypoint files that require the needed files. E.g. how `spec_helper` requires the spec modules and your fixtures etc
irc_user has joined #crystal-lang
<yxhuvud> djberg96: No. That proposal looks kinda neat.
<yxhuvud> though having a `package` construct to go with it instead of reusing modules would probably be necessary, as noted in that discussion.
<riza> yeah it's an interesting patch, but man would that drop a bomb
<riza> i dont think that can be done without a new top level construct
walez__ has quit [Quit: Leaving]
walez__ has joined #crystal-lang
walez__ has quit [Quit: Leaving]
irc_user has quit [Quit: Connection closed for inactivity]
walez__ has joined #crystal-lang
_ht has joined #crystal-lang
<FromGitter> <djberg96> definitely agree that if implemented would require a new construct
<FromGitter> <spuun> About the 84codes images, open an issue and we'll look into it.
_ht has quit [Quit: _ht]
<SamantazFox> Hello there!
<FromGitter> <Blacksmoke16> uh oh
<SamantazFox> I don't understand the difference between `@type.id` and `@type.name`
<SamantazFox> Blacksmoke16: Why "uh oh"? xDD
<FromGitter> <Blacksmoke16> normally you saying hello means there's a problem :P
<SamantazFox> xDDD
<FromGitter> <Blacksmoke16> pretty sure they're essentially the same in this context
<SamantazFox> mmmhhh
<SamantazFox> How can I get `BarClass` alone then?
<FromGitter> <Blacksmoke16> for type nodes at least
<FromGitter> <Blacksmoke16> `@type.id.split("::").last`
<SamantazFox> Ok, thanks :)
<SamantazFox> I'm kinda disappointed that either `.name` or `.class_name` doesn't return the module/struct/class name alone :c
<FromGitter> <Blacksmoke16> there's also an undocumented method `identify`, idk what the point of it is tho. basically turns like `Test::BarClass` into `Test__BarClass` :shrug:
<FromGitter> <Blacksmoke16> `@type.id.identify`
<FromGitter> <Blacksmoke16> think the catch there is what would happen if there was two types with that name in diff namespaces?
<SamantazFox> My goal is to have a YAML config that is based on the class names
<FromGitter> <Blacksmoke16> should prob use the FQN then to be on the safe side
<SamantazFox> the problem is that the FQN won't be user friendly...
<FromGitter> <Blacksmoke16> if you can be assured there wont even be a case like like `MyApp::Admin::Jobs::Thing` and `MyApp::Core::Jobs::Thing`
<FromGitter> <Blacksmoke16> then its prob fine, otherwise wouldnt know which one to use?
<SamantazFox> the FQN is used to initialize the variable, so that won't be a problem on that part
<SamantazFox> the problem will be that there are two properties with the same name
<SamantazFox> but that shouldn't happen (and if it does, the compiler won't be happy, I guess?)
<FromGitter> <Blacksmoke16> the latter one would override the first
<SamantazFox> Ah, ok, good to know.
ur5us has joined #crystal-lang
<SamantazFox> Hmm, problem of `.split("::")` is that I'm getting a StringLiteral
<FromGitter> <Blacksmoke16> then call `.id` on that
<SamantazFox> How do I convertBack to a MacroId?
<SamantazFox> Ah, ok
walez__ has quit [Quit: Leaving]
<SamantazFox> Blacksmoke16 thanks for your help, as always ^^
<FromGitter> <Blacksmoke16> np
lanodan has left #crystal-lang [WeeChat 3.5]