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
hendursaga has quit [Remote host closed the connection]
hendursaga has joined #crystal-lang
sagax has joined #crystal-lang
f1refly has quit [Quit: see ya in hell]
f1refly has joined #crystal-lang
maxpowa has quit [Ping timeout: 250 seconds]
maxpowa has joined #crystal-lang
f1refly has quit [Quit: see ya in hell]
f1refly has joined #crystal-lang
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 260 seconds]
f1reflyylmao is now known as f1refly
maxpowa has quit [Ping timeout: 250 seconds]
f1refly has quit [Quit: see ya in hell]
maxpowa has joined #crystal-lang
f1refly has joined #crystal-lang
f1refly has quit [Client Quit]
f1refly has joined #crystal-lang
f1refly has quit [Client Quit]
f1refly has joined #crystal-lang
f1refly has quit [Quit: see ya in hell]
f1refly has joined #crystal-lang
f1refly has quit [Quit: see ya in hell]
f1refly has joined #crystal-lang
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [Ping timeout: 268 seconds]
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 268 seconds]
astronavt has joined #crystal-lang
<FromGitter> <elementio:salt-rock-lamp.ems.host> hi crystal people, is there somewhere in the docs that states what you have to `require` in order to use some given data type in the std lib? i just spent 5 minutes being very confused, until i realized that i needed to write `require "json"` in order to use `#to_json`...
<FromGitter> <Sija> @elementio:salt-rock-lamp.ems.host Usually there’s a `NOTE` re: the `require` (is needed) somewhere at the beginning of the docs for the given module
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [Ping timeout: 268 seconds]
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
hendursa1 has joined #crystal-lang
hendursaga has quit [Ping timeout: 240 seconds]
_ht has joined #crystal-lang
chachasmooth has quit [Read error: Connection reset by peer]
chachasmooth has joined #crystal-lang
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 265 seconds]
<FromGitter> <Groogy> Yo! Is there a short hand for comparing each element in an array with each other? `#each_combination`?
<jhass> yeah, that's probably as succint as you get it
<jhass> note there's an iterator returning overload, so you can chain .all? or whatever
DeBot has joined #crystal-lang
<FromGitter> <Groogy> Hmm thinking more about it prob not what I want, thx anyway jhass
<FromGitter> <Groogy> the comparison I am trying to do is "obj at index X value needs to be less than the next one" and if I could put that in a oneliner that would be awesome
<jhass> basically that it's sorted?
<jhass> could check a.sort == a
<jhass> or .each_cons(2).all? {|a, b| a < b } or something like that
<FromGitter> <Groogy> think second one would be more efficent
<FromGitter> <oprypin:matrix.org> @Groogy: dont forget to apply `reuse: true`
<FromGitter> <Groogy> ah true thx
<FromGitter> <Groogy> each_cons_pair would be more optimized right?
<FromGitter> <oprypin:matrix.org> @Groogy: yes but it has no iterator version
<FromGitter> <Groogy> ah
<FromGitter> <Groogy> `invariant @control_points.each_cons(2, true).all? { |a,b| a.end_time < b.start_time }`
<FromGitter> <oprypin:matrix.org> does that actually work? it might need to be `|(a,b)|`
<FromGitter> <Groogy> Haven't used the Iterator much so should probably experiment with it bit more
<FromGitter> <oprypin:matrix.org> there are also these variants which would be more efficient
<FromGitter> <oprypin:matrix.org> https://carc.in/#/r/aubq
<FromGitter> <Groogy> yeah you're right
<FromGitter> <oprypin:matrix.org> https://carc.in/#/r/aubr
DTZUZU_ has joined #crystal-lang
<jhass> they asked for a one-liner though :P
<FromGitter> <Groogy> yeah but hoped the oneliner would be readable so reconsidering that a bit right now
DTZUZU has quit [Ping timeout: 240 seconds]
<FromGitter> <Groogy> `invariant @control_points.each_cons(2, true).all? { |(a,b)| a.end_time < b.start_time }` ⏎ versus ⏎ `invariant control_points_in_order?` ⏎ better name pending [https://gitter.im/crystal-lang/crystal?at=6073031806e2e024e84819aa]
<FromGitter> <Groogy> thanks for the help!
deavmi has quit [Quit: No Ping reply in 180 seconds.]
deavmi has joined #crystal-lang
shalokshalom has joined #crystal-lang
shalokshalom has quit [Quit: https://quassel-irc.org - Komfortabler Chat. Überall.]
<FromGitter> <Daniel-Worrall> You should use `.each.cons_pair`
<FromGitter> <Daniel-Worrall> It's the iterator version
<FromGitter> <Daniel-Worrall> And it's optimised for being 2 elements
<FromGitter> <oprypin:matrix.org> oh nice. cc @Groogy
<FromGitter> <Groogy> oh cool thx
<FromGitter> <Groogy> Works perfectly yeah
<FromGitter> <Groogy> But think I am okay with not having the invariant be a oneline like I asked at start but name a function to describe the expected behaviour better: https://gist.github.com/Groogy/4f60b620407a072675d20d4b4da291c1
SuperFamicom[m] has quit [Quit: Idle for 30+ days]
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 240 seconds]
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
_ht has quit [Remote host closed the connection]
<FromGitter> <elementio:salt-rock-lamp.ems.host> Has anyone here had a dependency resolution issue with building Scry? I posted an issue on GH: https://github.com/crystal-lang-tools/scry/issues/185
<FromGitter> <elementio:salt-rock-lamp.ems.host> Am i missing some basic setup step?
<FromGitter> <Blacksmoke16> `--ignore-crystal-version` run it with that for now
<FromGitter> <Blacksmoke16> a new release needs tagged for 1.0.0 compatibility, see also https://github.com/crystal-lang/shards/pull/493
<FromGitter> <elementio:salt-rock-lamp.ems.host> I see, thank you
<FromGitter> <elementio:salt-rock-lamp.ems.host> I'm a bit surprised nobody else seemed to have this problem... are crystal devs generally in the habit of using that flag?
<FromGitter> <Blacksmoke16> probably, or just havent been using scry
<FromGitter> <asterite> I think crystalline is used more than scry, but I don't know
hendursa1 has quit [Remote host closed the connection]
hendursa1 has joined #crystal-lang
entel has joined #crystal-lang
<FromGitter> <elementio:salt-rock-lamp.ems.host> i think scry was linked on the website while crystalline was not. is there a reason to prefer one over the other?
<FromGitter> <Blacksmoke16> afaik crystalline is more maintained
<FromGitter> <Blacksmoke16> on the website where?
<FromGitter> <elementio:salt-rock-lamp.ems.host> i thought maybe somewhere on the crystal site
<FromGitter> <elementio:salt-rock-lamp.ems.host> but i might be mistaken
<FromGitter> <Blacksmoke16> :shrug: is possible
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [Ping timeout: 240 seconds]
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 240 seconds]