Unusual Raku Features
buttondown.com
Unusual Raku Features
1–10 of 166 posts
Re: Unusual Raku Features
#2 > (2,4,8...*)[17]
262144
This one genuinely surprised meRe: Unusual Raku Features
#3Re: Unusual Raku Features
#4> (2,4,8...*)[17] 262144 This one genuinely surprised me
Re: Unusual Raku Features
#5> (2,4,8...*)[17] 262144 This one genuinely surprised me
I guess (apart from the Whatever), the laziness is new since Perl6/Raku.
Re: Unusual Raku Features
#6Should it be `returns (32, 54)` ? i.e. 4+50 for the 2nd term.
Maybe this is a consequence (head translation) of some countries saying e.g. vierenvijftig (four and fifty) instead of the English fifty-four.
Re: Unusual Raku Features
#7Re: Unusual Raku Features
#8It is absolutely mindbending to me that all of this language development has happened on top of Perl, of all things.
Why "of all things?" The Perl philosophy of TIMTOWTDI, and Wall's interest in human-language constructs and the ways that they could influence programming-language constructs, seem to make its successor an obvious home for experiments like this.
Re: Unusual Raku Features
#9Re: Unusual Raku Features
#10> (2,4,8...*)[17] 262144 This one genuinely surprised me
The detecting of increments has been in Perl6 for ages so that's not new. [edit Perl6 not Perl) I guess (apart from the Whatever), the laziness is new since Perl6/Raku.
But this is detecting that the increment is multiplicative, rather than additive. It might seem like a natural next step, but, for example, I somewhat suspect (and definitely hope) that Raku wouldn't know that `(1, 1, 2...*)` is a (shifted) list of Fibonacci numbers.