In a reply to my recent blog post, Markus H. replied with a very succinct code alternative, namely:
dd $_ for (4, 4.25, 108 – (815 – 1500 / * ) / * … *)[^30].kv
Sadly I cannot get this to work "out of the box" and get this error:
Confused
at /Users/stephenroe/Dropbox/RakuStuff/mullerrec/./mullerrec3.raku:27
------> dd $_ for (4, 4.25, 108⏏ – (815 – 1500 / * ) / * … *)[^30].kv
expecting any of:
infix
infix stopper
statement end
statement modifier
statement modifier loop
How can I fix this?
Here's the code that I can get to work (yes, my style is a bit different, but that's ok):
sub f(\y,\z) {
108 - ( (815 - 1500/z ) / y )
}
dd $_ for (4, 4.25, -> \z,\y {f(y,z)} … ∞)[^30].kv;
As a follow up, I think I need to swap the params to f, but Markus has not done that, who is right? I am keen to know if that is a gotcha and, then the question is "how can I reverse the order by which whatever stars are consumed"?
Or maybe something like:
dd $_ for (4, 4.25, f(^z,^y) … ∞)[^30].kv; #not legal