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
ur5us_ has quit [Ping timeout: 260 seconds]
ur5us_ has joined #crystal-lang
<FromGitter> <HertzDevil> if that `else` works then it is a bug and it shouldn't work
<FromGitter> <HertzDevil> and it, in fact, also doesn't
<FromGitter> <HertzDevil> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=614d4f615cfd665e524166bc]
<FromGitter> <HertzDevil> same error
<FromGitter> <HertzDevil> but when the `when` clause is a type or constant it expands to `State::TWO == @state` which doesn't depend on `@state`'s type
ur5us_ has quit [Ping timeout: 260 seconds]
sorcus has quit [Ping timeout: 260 seconds]
notzmv has joined #crystal-lang
postmodern has joined #crystal-lang
<postmodern> is there an easy way to wrap one Iterator class around another? Say I have an Iterator that cycles through Strings of a given length. Then I have another iterator that iteratoes through an Array or Range of lengths. How could I combine the two to iterate over all strings of a set of lengths?
repo has quit [Quit: WeeChat 3.2]
<FromGitter> <oprypin:matrix.org> postmodern, i don't think there is an easy way. you just create a new class. by this point most languages have generator functions but crystal doesn't.
<yxhuvud> most languages? I think that is your python heritage speaking. They are not uncommon, but I wouldn't say most languages have them.
<FromGitter> <oprypin:matrix.org> yxhuvud, C#, JavaScript, C++
<FromGitter> <oprypin:matrix.org> by volume of usage, most
<yxhuvud> As opposed to Java, Go, Ruby, C etc, that does not.
<postmodern> ah fascinating use of Channel to wrap around the yielding method
<yxhuvud> Hmm. I wonder if it could make sense to implement some way of feeding a channel from an arbitrary iterator without having to continously swap the fiber stacks back and forth.
postmodern has quit [Remote host closed the connection]
Vexatos_ has quit [Quit: Client Quit]
Vexatos has joined #crystal-lang
r0bby has quit [Ping timeout: 268 seconds]
r0bby has joined #crystal-lang
SamantazFox has quit [Ping timeout: 260 seconds]
sorcus has joined #crystal-lang
SamantazFox has joined #crystal-lang
f1refly has quit [Quit: see ya in hell]
f1refly has joined #crystal-lang
SamantazFox has quit [Remote host closed the connection]
SamantazFox has joined #crystal-lang