<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
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]
<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.
most languages? I think that is your python heritage speaking. They are not uncommon, but I wouldn't say most languages have them.
<oprypin:matrix.org> by volume of usage, most
As opposed to Java, Go, Ruby, C etc, that does not.