<FromGitter>
<AlexCouch> Hey, I'm having a strange issue with shards and crystal compiler right now. Not sure what I did wrong but it was working just fine the other day. I have a dependency through shard.yml and it's installed inside the lib directory. When I try to require it, according to the rules for requiring files, it *should* find the file under lib/icmp/src/icmp.cr, but the compiler for some reason isn't finding it. I
<FromGitter>
... compiled it just the other day and it was fine but now it's not. I'm not sure what I did wrong. I'm running in the project root directory. This occurs if I run `shards build` or `crystal build src/main.cr`. I can't seem to find any reason why the compiler can't see the file anymore.
<FromGitter>
<AlexCouch> Does this sound like something that has happened before due to some change to the environment somehow?
<FromGitter>
<Blacksmoke16> can you share some code of how you're requiring it, shard.yml
<FromGitter>
<AlexCouch> Sure
<oprypin>
@AlexCouch `echo $CRYSTAL_PATH`
<oprypin>
`which crystal`
<FromGitter>
<AlexCouch> Yeah that's fine I already checked
<oprypin>
`crystal env`
<oprypin>
@AlexCouch: you shouldn't decide what's fine now that you're asking for help :o
<foxxx0>
does the Array#map combined with #any? or #all? support early-abort? e.g. I have something like my_array.map { |x| some_bool_expr(x) }.any? or .all? at then end. will it return `true` for .any? at the very first intermediate map result that evaluates to true? and likewise will it return `false` for .all? at the very first intermediate result that evaluates to false?
<foxxx0>
or does it need to compute all intermediate results of the .map call?
<Andriamanitra>
foxxx0: no, it first does the mapping, but you can call "break" inside the #map block
<foxxx0>
okay, i'll try that
<Andriamanitra>
also if you're not actually using the results of the #map you can just use #any? or #all? with a block
<foxxx0>
oh really?
<foxxx0>
and that will already return early then?
<Andriamanitra>
yes
<foxxx0>
sweet, i'm gonna give these a try and play with them. thanks!
<foxxx0>
thanks, #any? / #all? with a block is exactly what i was looking for! :)
<FromGitter>
<erdnaxeli:cervoi.se> is there a way to print many variable on a line?
<FromGitter>
<Aaron-JM> Hey everyone, im currently facing the following error: fun redefintion with different signature. I have two functions in C code with thr sam
<FromGitter>
<erdnaxeli:cervoi.se> puts/p a, b, c prints them on separated lines
<FromGitter>
<Aaron-JM> The same identifier*
<Andriamanitra>
i use puts [a, b, c]
<Andriamanitra>
it's close enough for my needs
<FromGitter>
<erdnaxeli:cervoi.se> good idea, thanks!
<foxxx0>
is it possible to "rewind" an iterator back to the beginning / initial state?
<FromGitter>
<naqvis> no, `Iterators` are forward only.
<Andriamanitra>
depending on what exactly you're trying to achieve there's likely a better way, for example #cycle might be something to look at
<foxxx0>
me, maybe allocating it as an array might actually be a good idea. i want to split the work to multiple fibers in parallel and need to know the size beforehand to equally distribute the chunks
<foxxx0>
so looks like i need .to_a anyways
zorp has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
<FromGitter>
<Blacksmoke16> pretty sure `m` is never going to be nil, but a specific capture group mght
<FromGitter>
<Daniel-Worrall> m is nil if there's no match
<FromGitter>
<Blacksmoke16> fair enough
<Andriamanitra>
yeah but inside that block it can't be nil.. i guess the compiler isn't smart enough to know that it in this case it can't ever have nil groups here
<FromGitter>
<Daniel-Worrall> It's always [] of String?
<FromGitter>
<Daniel-Worrall> so you'll need to `not_nil!` as neccesary it seems
<FromGitter>
<Blacksmoke16> > # When this regex has an optional group, result array may contain ⏎ ⏎ #a `nil` if this group is not matched.
<FromGitter>
<Daniel-Worrall> It's incase you have an optional match, yea
<FromGitter>
<Daniel-Worrall> That's a chonky text o.o
<FromGitter>
<tenebrousedge> `not_nil!` or `try`
<FromGitter>
<Blacksmoke16> quote picked up the `#` from the comments :p
krobin has quit [Quit: brb]
_ht has quit [Remote host closed the connection]
<FromGitter>
<jrei:matrix.org> so much better to use the Element mobile app instead of Gitter :)
<straight-shoota>
IRC is nice, too =)
<FromGitter>
<jrei:matrix.org> IRC has done its time. There are less and less people using it (but still a lot)
<FromGitter>
<jrei:matrix.org> at least reduced by half since the last 20 years
<straight-shoota>
but it works
<FromGitter>
<jrei:matrix.org> hopefully, other solutions don't?
<straight-shoota>
sure, more modern ones do work as well.
<straight-shoota>
but something that works, doesn't really need replacement
<straight-shoota>
even if it's old
<raz>
nothing beats IRC
<FromGitter>
<jrei:matrix.org> It is really nice to chat to IRC through ELement now. It was always a pain to access to IRC
<straight-shoota>
why pain?
<FromGitter>
<jrei:matrix.org> I need the captcha, then a confirmation mail, then there were some other boring stuff to prevent bots
<raz>
irc clients still suck. but i can conveniently follow and chat in two dozen unrelated channels here over years. and all important communities are still primarily on IRC.
<FromGitter>
<jrei:matrix.org> The Element client, in which you can chat to Freenode channels, is so much easier to start using
<raz>
ah gonna look into it. i want to like matrix. but the whole bridging is a pita
<FromGitter>
<jrei:matrix.org> why, no?
<raz>
e.g. i can't autocomplete your name because you talk through a bot
<raz>
or two bots even...
<FromGitter>
<jrei:matrix.org> tested, it works
<FromGitter>
<jrei:matrix.org> they have much improved the clients since Riot.im :)
<raz>
well maybe for you, but not for us on irc
<raz>
FromGitter <jrei:matrix.org> tested, it works
<FromGitter>
<jrei:matrix.org> you know, Element has nothing to do with this bot
<FromGitter>
<jrei:matrix.org> that's the Crystal community one
<raz>
well, it goes through matrix, which apparently goes through gitter somehow
<FromGitter>
<jrei:matrix.org> Gitter and Matrix are binded yes. And this is a Gitter bot made in Crystal (Critter I think?)
<raz>
hmm looks like matrix has a direct irc bridge now