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
debayer948 has quit [Remote host closed the connection]
debayer948 has joined #crystal-lang
Guest41 has joined #crystal-lang
Guest41 has quit [Client Quit]
debayer948 has quit [Remote host closed the connection]
debayer948 has joined #crystal-lang
debayer948 has quit [Remote host closed the connection]
debayer948 has joined #crystal-lang
postmodern has joined #crystal-lang
debayer948 has quit [Remote host closed the connection]
debayer948 has joined #crystal-lang
<postmodern> what types of code are allowed inside of enums? I'm wanting to write an enum, but add a constant that maps Strings (file extension names) to the enum values and use that in a class-method that determins the enum value based on a path's file extension
<postmodern> i get this error "invalid constant value" https://carc.in/#/r/cno9 on the "FILE_FORMATS = {" line
frojnd1 is now known as frojnd
<postmodern> also how do people test code that relies on `ENV`?
<postmodern> do you add an argument that defaults to `ENV` to allow passing in a custom mock `ENV` Hash in your specs?
debayer948 has quit [Remote host closed the connection]
debayer948 has joined #crystal-lang
<straight-shoota> Yeah, enums can't have any constants other than members. You could use a class variable instead.
<straight-shoota> You can mutate `ENV` in the setup step of a spec and later reset it
HumanG33k has quit [Ping timeout: 240 seconds]
taupiqueur has joined #crystal-lang
debayer948 has quit [Remote host closed the connection]
debayer948 has joined #crystal-lang
<postmodern> straight-shoota, ah, i thought ENV was read-only?
<straight-shoota> nope: https://crystal-lang.org/api/1.3.2/ENV.html#%5B%5D%3D%28key%3AString%2Cvalue%3AString%3F%29-class-method
<straight-shoota> It gives access to the process' environment which is mutable
<postmodern> when would you use a NamedTuple vs a Struct to pass multiple values around as a single object?
<FromGitter> <Blacksmoke16> a struct prob 99% of the time
<FromGitter> <Blacksmoke16> named tuple really only exists to represent named args passed to a function and shouldnt be used for modeling data
<postmodern> even if your using this struct/tuple to pass a grouping of values via yield to another method?
<FromGitter> <Blacksmoke16> i prob would yea
xyhuvud has quit [Read error: Connection reset by peer]
yxhuvud has joined #crystal-lang
debayer948 has quit [Ping timeout: 256 seconds]
debayer948 has joined #crystal-lang
debayer948 has quit [Quit: Ping timeout (120 seconds)]
debayer948 has joined #crystal-lang
debayer948 has quit [Ping timeout: 256 seconds]
debayer948 has joined #crystal-lang
taupiqueur has quit [Quit: taupiqueur]
debayer948 has quit [Remote host closed the connection]
debayer948 has joined #crystal-lang
debayer948 has quit [Ping timeout: 256 seconds]
debayer948 has joined #crystal-lang
ur5us has joined #crystal-lang
debayer948 has quit [Ping timeout: 240 seconds]
debayer948 has joined #crystal-lang
yxhuvud has quit [Ping timeout: 240 seconds]
yxhuvud has joined #crystal-lang
debayer948 has quit [Remote host closed the connection]
debayer948 has joined #crystal-lang
debayer948 has quit [Ping timeout: 256 seconds]
debayer948 has joined #crystal-lang
debayer948 has quit [Quit: Ping timeout (120 seconds)]
debayer948 has joined #crystal-lang
debayer948 has quit [Ping timeout: 240 seconds]
<FromGitter> <RespiteSage> Maybe it just doesn't work for enum? https://carc.in/#/r/cnsr
debayer948 has joined #crystal-lang
<FromGitter> <jrei:matrix.org> maddi could one use Rosetta (the 1st) inside Rosetta 2? :)
debayer948 has quit [Ping timeout: 240 seconds]
debayer948 has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]