how to cycle through list indefinitely and lazily in Raku?
When it can be written this short, why add a feature just for that. Especially since it is probably a rare event that you would need such a thing.
|< a b c > xx *
Well there is one exception, if you use something like «~»
it extend it out for you.
< a b c > «~» (1..10)
# (a1 b2 c3 a4 b5 c6 a7 b8 c9 a10)
I don't know if I understood the problem. But what I understood that you need a method to produce infinite list following a pattern. Well if that's the problem in the book "Think in Raku" comes with something that may help, in the part 14.5 (adapted from how to do a Fibonacci sequence)
("a","b","c", -> $a, $b, $c {$a} ...* )
this element is the pure-list, if you want the extract values you need something like more conventional on list (like assign & extract values)
my @list = ("a","b","c", -> $a, $b, $c {$a} ...* )
@list[0..100]
@list[91]
I think that's it's not good idea using map in a Inf context, but please tell me if I missed something, i still learning about this awesome language too !!