jhass changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Crystal 0.35.1 | 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
<oprypin> [01:45:04] <oprypin> Matrix1 <-> IRC <-> Gitter <-> Matrix2
<oprypin> [01:47:13] <oprypin> and, well, the Matrix ones are managed by Matrix and are more seamless
<oprypin> [01:45:27] <oprypin> where Matrix1 is a channel that's basically impossible to join and Matrix2 is new
<oprypin> [01:48:03] <oprypin> unfortunately adding Matrix1 <-> Gitter or IRC <-> Matrix2 is not possible
<oprypin> Matrix1 is [00:46:00] <58afb3raz> try joining #freenode_#crystal-lang:matrix.org
<oprypin> i don't know how anyone can seriously say irc is better when the feature set is shit and you have to maintain a bouncer
<oprypin> matrix is no worse than irc in any single aspect
<oprypin> im switching to that as soon as some bridging features catch up
<Andriamanitra> raz: have you tried weechat? it's amazing, irc clients definitely don't suck :)
<FromGitter> <ryanprior:matrix.org> I like Matrix & have done all my IRC chatting through Matrix for the past ~year.
<FromGitter> <jrei:matrix.org> oprypin how bridging features blocks you to use a matrix client? ⏎ ... IRC <-> Matrix2 is not possible?
<FromGitter> <jrei:matrix.org> nvm, it does not whatI think it does
<FromGitter> <jrei:matrix.org> better to wait yes
<FromGitter> <jrei:matrix.org> when Gitter will became "just" a Matrix client, things will be simpler
hightower4 has quit [Remote host closed the connection]
chachasmooth has quit [*.net *.split]
gangstacat has quit [*.net *.split]
asterite has quit [*.net *.split]
bougyman has quit [*.net *.split]
Liothen has quit [*.net *.split]
raz has quit [*.net *.split]
asterite has joined #crystal-lang
bougyman has joined #crystal-lang
chachasmooth has joined #crystal-lang
raz has joined #crystal-lang
gangstacat has joined #crystal-lang
Liothen has joined #crystal-lang
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
f1refly has quit [Ping timeout: 268 seconds]
f1refly has joined #crystal-lang
f1refly has quit [Client Quit]
f1refly has joined #crystal-lang
f1refly has quit [Quit: bye fags]
f1refly has joined #crystal-lang
f1refly has quit [Client Quit]
f1refly has joined #crystal-lang
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 240 seconds]
avane has quit [Quit: ZNC - https://znc.in]
avane has joined #crystal-lang
f1reflyylmao is now known as f1refl
f1refl is now known as f1refly
bazaar has quit [Ping timeout: 246 seconds]
bazaar has joined #crystal-lang
_ht has joined #crystal-lang
teardown has quit [Ping timeout: 240 seconds]
teardown has joined #crystal-lang
<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"
zorp has quit [Ping timeout: 268 seconds]
<oprypin> foxxx0, {{ flag?( ) }}
<foxxx0> oprypin: ah thanks, that works! :)
<frojnd> Looking at: https://crystal-lang.org/api/0.35.1/JSON.html#build(io:IO,indent=nil,&):Nil-class-method JSON.build method And am tyring to fiure out how to build in a way like this: https://carc.in/#/r/a4is how can I achieve such nested json?
<FromGitter> <erdnaxeli:cervoi.se> the easier way would be to have a struct that reflects it, and then use to_json
<FromGitter> <erdnaxeli:cervoi.se> but if you want to build it yourself, there is an example just here: https://crystal-lang.org/api/0.35.1/JSON.html#build(indent=nil,&)-class-method
<frojnd> Cna you give me an example with structs please?
<frojnd> Ok I see now
<frojnd> Thank you
FromGitter has quit [Remote host closed the connection]
oprypin has quit [Quit: Bye]
oprypin has joined #crystal-lang
FromGitter has joined #crystal-lang
<FromGitter> <tenebrousedge> is there a `take_until` ?
<FromGitter> <tenebrousedge> `first` i guess works
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Enumerable.html#take_while(&)-instance-method
<FromGitter> <tenebrousedge> right but `take_until` would be taking until the block evaluates to `true`
<FromGitter> <Blacksmoke16> cant just do like `!(expression)`?
<FromGitter> <Blacksmoke16> to get same functionality?
<FromGitter> <tenebrousedge> not if I'm using `take_until(&.method)`
<FromGitter> <Blacksmoke16> `&.!.&.method`
<FromGitter> <Blacksmoke16> or something like that
<FromGitter> <tenebrousedge> are you sure that works/
<FromGitter> <tenebrousedge> ?
<FromGitter> <Blacksmoke16> 80%
<FromGitter> <tenebrousedge> `icr` will eval it but it doesn't seem to work
<FromGitter> <tenebrousedge> `(1..4).take_while(&.!.==(3)) #=> [] `
<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)
<raz> why do i even ask ¯\_(ツ)_/¯
<raz> should file a bug on your version number sometime, i think you got minor/major confused there :p
<FromGitter> <Blacksmoke16> hm?
<raz> there's not enough stuff missing for a 0.12
<FromGitter> <Blacksmoke16> ha
<FromGitter> <Blacksmoke16> i wish
<raz> well, my api is nearly finished and i've yet to find a complaint
<raz> but i'll keep looking! :p
<FromGitter> <Blacksmoke16> 👍
avane has quit [Ping timeout: 246 seconds]
avane has joined #crystal-lang
<FromGitter> <RespiteSage> Is `crystal format` in the `crystal-lang/crystal` repo?
<FromGitter> <RespiteSage> That is, is that where I can submit an issue or find the code?
<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?
<FromGitter> <tenebrousedge> `def new(s : String); etc; end; arr.map(&->MyType.new(String))`
<Andriamanitra> hmm do you mean that this would actually work with the type parameter as is if i had the right .new method?
<Andriamanitra> worth a try
<FromGitter> <tenebrousedge> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5fdba7649b548427b619b68f]
<FromGitter> <tenebrousedge> `self.new` I guess
<Andriamanitra> i still can't make the parse function work with type parameter
<Andriamanitra> oh nvm i'm stupid :D : T forall T is not at all what i needed here
<Andriamanitra> this works https://play.crystal-lang.org/#/r/a4lq
teardown has joined #crystal-lang
teardown_ has quit [Ping timeout: 240 seconds]
<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
<FromGitter> <RespiteSage> @andriamanitra https://play.crystal-lang.org/#/r/a4lz
<Andriamanitra> RespiteSage: thanks, that " : Class" is exactly what i was looking for
<FromGitter> <RespiteSage> No problem. I'm happy to help. :)
<oprypin> courtesy of the deleted markdown module 😑
<FromGitter> <RespiteSage> Ooh. That's a nice feature. Why was it deleted?
<FromGitter> <RespiteSage> Oh, wait. You mean `::Markdown`.
<FromGitter> <RespiteSage> Do you just have a local copy that you use? I see the `require "./markdown"` in `gitter.cr`.
<Andriamanitra> Hash#transform_keys doesn't preserve default_value
<Andriamanitra> bug or not?
<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
coderobe has joined #crystal-lang
chachasmooth has quit [Ping timeout: 260 seconds]
chachasmooth has joined #crystal-lang