> On Sep 3, 2022, at 12:17 PM, Marc Chantreux <[email protected]> wrote:
--snip--
> I thought the raku one could be shorter
It will be hard to beat the brevity of a language with single-character
instructions.
--snip--
> I'm pretty sure I saw a very concise and elegant way to transform
> ( A B C ) to ((A) (A B) (A B C))
Perhaps you are remembering `produce()`, also called "triangular reduce":
https://docs.raku.org/routine/produce
https://docs.raku.org/language/operators#Reduction_metaoperators
$ raku -e 'say [\,] <A B C>;'
((A) (A B) (A B C))
$ echo /var/log/messages | raku -ne '.say for [\~] .comb: /\/<-[/]>+/;'
/var
/var/log
/var/log/messages
--
Hope this helps,
Bruce Gray (Util of PerlMonks)