<foxxx0>
hi, the macro `flag?()` is available in the top-level-namespace. how do I access that from within a custom class? I've tried `Crystal::Macros.flag?()` and `Macros.flag?()` but both just throw compile errors "undefined constant"
<FromGitter>
<Blacksmoke16> well that would just be `&.!=(3)` no?
<FromGitter>
<tenebrousedge> yus
<FromGitter>
<tenebrousedge> `(1..40.take_while(&.!.even?)` also doesn't work
<FromGitter>
<Blacksmoke16> `.take_while(&.even?.!)` try that
<FromGitter>
<tenebrousedge> there we go
<FromGitter>
<tenebrousedge> but...ew
<FromGitter>
<erdnaxeli:cervoi.se> I like concision too but .take_while { |x| !x.even? } is more readable :p
<FromGitter>
<tenebrousedge> I think both are bad and `take_until(&.even?)` is best
<o5r>
Is there a way to see an expanded macro?
<FromGitter>
<Blacksmoke16> `{{debug}}` add that at the end of it
<o5r>
Ah, cool! Thanks!
<FromGitter>
<erdnaxeli:cervoi.se> oh! this is way better that the expand tool
teardown_ has joined #crystal-lang
teardown has quit [Ping timeout: 240 seconds]
oprypin has quit [Quit: Bye]
FromGitter has quit [Remote host closed the connection]
oprypin has joined #crystal-lang
FromGitter has joined #crystal-lang
<raz>
blacksmoke16: can an athena Controller inject a prefix into all contained routes? e.g. would be handy if a UsersController could prefix all its routes with /users/
<raz>
(mostly cosmetic of course, not a prio thing)
<FromGitter>
<RespiteSage> For future reference, @irc people, do links like that show up as the markdown?
<Andriamanitra>
is it possible to make something like this happen (obviously with my own types, Int32 and UInt64 are just placeholders here)? https://play.crystal-lang.org/#/r/a4lg
<FromGitter>
<tenebrousedge> you want `scanf`
<FromGitter>
<tenebrousedge> hmm, actually
<FromGitter>
<tenebrousedge> if you have your own types why not just define a `new` that would handle that?
<Andriamanitra>
although compiler (maybe expectedly) still doesn't like it at all when i try to use that parameter as a parameter to Array(T) for example :p https://play.crystal-lang.org/#/r/a4lu
<oprypin>
RespiteSage, ye i copy the version right before the removal
teardown has quit [Ping timeout: 240 seconds]
teardown has joined #crystal-lang
teardown_ has joined #crystal-lang
<FromGitter>
<tenebrousedge> it's kinda sorta a bug
<FromGitter>
<tenebrousedge> I opened an issue for the hash default value thing a year ago
<FromGitter>
<tenebrousedge> i wonder if I know enough to fix it now
<FromGitter>
<tenebrousedge> the bang version should preserve the defaults
teardown has quit [Ping timeout: 240 seconds]
zorp has joined #crystal-lang
sorcus has quit [Quit: WeeChat 2.9]
_ht has quit [Remote host closed the connection]
sorcus has joined #crystal-lang
sorcus has quit [Quit: WeeChat 2.9]
sorcus has joined #crystal-lang
teardown has joined #crystal-lang
teardown_ has quit [Ping timeout: 240 seconds]
<FromGitter>
<anthonyshull> is it possible to define an instance property in a module?
<FromGitter>
<anthonyshull> don't see it in the docs
<straight-shoota>
yes
<FromGitter>
<watzon> As long as that module is being imported into a class or struct. `self.` methods obviously can't access instance properties, since there's no instance for them to access.
<FromGitter>
<anthonyshull> nice
<raz>
mmm clean is so clean. starting to like it a little more than jennifer
<raz>
clear even
<straight-shoota>
yeah, only thing I don't like is the pseudo code that translates to SQL
coderobe has quit [Quit: Ping timeout (120 seconds)]
<straight-shoota>
but you can just pass strings with real SQL, so no need to use that