<FromGitter>
<tenebrousedge> `icr` is nice for answering questions like that. Also the local and online playgrounds
<FromGitter>
<Blacksmoke16> icr is not great
<FromGitter>
<tenebrousedge> wjat
<FromGitter>
<Blacksmoke16> just have a file called `test.cr` and run it
<FromGitter>
<Blacksmoke16> ^
<FromGitter>
<tenebrousedge> I um. `icr` has limitations, but I still like REPLs
<FromGitter>
<Blacksmoke16> if it works for you great, but its not something i would test things with
<FromGitter>
<Blacksmoke16> as it does things unique to it
<FromGitter>
<tenebrousedge> yes, it displays a notice to that effect on startup. It does have relatively limited utility compared to `pry` or even `psy`, but does usually work to answer questions like the above
<FromGitter>
<tenebrousedge> as a tool for serious development, it's probably best avoided
<FromGitter>
<tenebrousedge> as a "does this language work the way I think it does" it has a short feedback loop
<FromGitter>
<elementio:salt-rock-lamp.ems.host> its pretty cool to have a repl for a compiled language so ill take it
<FromGitter>
<Blacksmoke16> Then leads to wrong understanding of how the language works because it's not using the actual language
<FromGitter>
<elementio:salt-rock-lamp.ems.host> ive been messing around with a `test.cr` file as well
<FromGitter>
<elementio:salt-rock-lamp.ems.host> i didnt think to try it as a top-level assignment
<FromGitter>
<tenebrousedge> it is using the actual language: anything compiled successfully by the crystal compiler must be Crystal code
<FromGitter>
<Blacksmoke16> Is possible for a bug to happen when using icr that otherwise wouldn't happen
<FromGitter>
<elementio:salt-rock-lamp.ems.host> can i disable ansi colors in the crystal cli?
<FromGitter>
<elementio:salt-rock-lamp.ems.host> i dont see a `--color=no` or equivalent option
<FromGitter>
<tenebrousedge> `icr --help`
<FromGitter>
<elementio:salt-rock-lamp.ems.host> ah it's an option to `run`
<FromGitter>
<elementio:salt-rock-lamp.ems.host> it's not in the top-level `--help`
<FromGitter>
<elementio:salt-rock-lamp.ems.host> if someone is willing to take a look and @ me here or comment on SO with revisions or corrections, i would appreciate it
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
kevinsjoberg has joined #crystal-lang
_ht has joined #crystal-lang
hendursaga has joined #crystal-lang
hendursa1 has quit [Ping timeout: 240 seconds]
deavmi has quit [Ping timeout: 260 seconds]
deavmi has joined #crystal-lang
<FromGitter>
<confact> Any way to make a hash of a class and its properties? It would be nice :D
<FromGitter>
<erdnaxeli:cervoi.se> nop, but you can easily generate the code that does that with a macro
<FromGitter>
<oprypin:matrix.org> erdnaxeli (https://matrix.to/#/@erdnaxeli:cervoi.se): instead of `i = 0_i32`
<FromGitter>
<erdnaxeli:cervoi.se> ah, good point
<FromGitter>
<oprypin:matrix.org> it's a weird way to get a zero of the current type. by now there's probably a better way
<FromGitter>
<erdnaxeli:cervoi.se> but I think it could use `self.class.zero`
<FromGitter>
<oprypin:matrix.org> would be interesting to compare the generated code in each case
<FromGitter>
<erdnaxeli:cervoi.se> is there a (simple) way to receive a message from a channel and prevent other message to be sent to this channel while I am processing the message? (with a non buffered channel) ⏎ Something like `channel.receive { |value| process(value) }`, and `send` would block until the block given to `receive` ends. ⏎ I could do something myself with two channel, but that's less simple...
<FromGitter>
<erdnaxeli:cervoi.se> actually what I want is to be sync, maybe I don't need a channel to communicate but just to give a callback to the fiber generating the value
<FromGitter>
<oprypin:matrix.org> erdnaxeli (https://matrix.to/#/@erdnaxeli:cervoi.se): it's hard to think of a way to do that but it's also hard to think how this could ever be useful
<FromGitter>
<oprypin:matrix.org> literally just call the method, dont use a channel
<FromGitter>
<erdnaxeli:cervoi.se> yeah ^^'
r0bby has quit [Read error: Connection reset by peer]
sz0 has quit [Read error: Connection reset by peer]
sz0 has joined #crystal-lang
r0bby has joined #crystal-lang
<FromGitter>
<rishavs> Have a coding pattern question. I am using a hash map to keep a list of all my api services. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I essentially escape from using a large case/if-else branching using a hash lookup, which I like. ... [https://gitter.im/crystal-lang/crystal?at=6081d600b9e6de24d65046d3]
<FromGitter>
<Daniel-Worrall> It is ran regardless of including or not
<FromGitter>
<Blacksmoke16> prob could just wrap it in `macro included`
<Andriamanitra>
ok i see why this is not working, would macros be the right way to do it then?
<FromGitter>
<Blacksmoke16> prob, or a diff design/approach
<Andriamanitra>
my goal is to separate different types of events across different files/modules so i could easily choose which ones to enable when compiling, is there a different (better) way to achieve this with some other design?
<FromGitter>
<Blacksmoke16> is there a reason to not just register them all?
<Andriamanitra>
yes, i don't want all of them running at the same time