Tech
Raku: a language that counts to infinity (Part 1)
We've already seen that Raku understands characters like β , and it would be logically that you can use them with ease, similar to any other constructs of the language.
Take, for example, a sequence with no definite end. You define a pattern and take as many items as you need.
say (1, 1, * + * ... β)[^10];
Here, the pattern defines a Fibonacci sequence and we only take the first 10 elements of it:
(1 1 2 3 5 8 13 21 34 55)
You don't know upfront what the 10 th element will be, s...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to