As to " but what's that cabbage thing before $c?": we have this great https://docs.raku.org site. And it has great search capability:
https://docs.raku.org/type/atomicint https://docs.raku.org/language/unicode_ascii#index-entry-%E2%9A%9B As to "this completely lost me": there was a mistype and "taking" shoud've been "talking". Sorry for this. "Weird/will Ass Thing" made me totally lost as I've no idea what this means. Best regards, Vadim Belman > On May 24, 2021, at 10:11 AM, Andy Bach <andy_b...@wiwb.uscourts.gov> wrote: > > my atomicint $c = 0; > sub foo($) { ++⚛$c }('a' | 'b,b' | 'c'); > say $c; > > I was sort of hanging on by my fingertips (this completely lost me: > >Or, taking about tricks: > > ('a' | 'b,b' | 'c')».&(-> $ { ++⚛$c }); > > ) but what's that cabbage thing before $c? Oh, and WAT is" Weird/will Ass > Thing"? > From: Vadim Belman <vr...@lflat.org <mailto:vr...@lflat.org>> > Sent: Monday, May 24, 2021 8:53 AM > To: perl6-users <perl6-us...@perl.org <mailto:perl6-us...@perl.org>> > Subject: Re: File::Find using a junction with exclude > > CAUTION - EXTERNAL: > > > Still ugly but much more reliable trick would be to use a sub and a counter > variable: > > my atomicint $c = 0; > sub foo($) { ++⚛$c }('a' | 'b,b' | 'c'); > say $c; > > Or, taking about tricks: > > ('a' | 'b,b' | 'c')».&(-> $ { ++⚛$c }); > > Apparently, this one is not ugly by semantics, but by its notation too. Also > worth noting that the hyper-op is needed here because pointy blocks are not > auto-threaded over junctions and take them as-is: > > -> $v { say $v.WHAT }(1|2); # (Junction) > > Best regards, > Vadim Belman > > > On May 24, 2021, at 8:42 AM, Daniel Sockwell <dan...@codesections.com> > > wrote: > > > >> It can be done without the EVAL: > >> > >>> any('a', 'b', 'c').raku.substr(4, *-1).split(',').elems > >> > >> 3 > > > > Yeah, but only at the cost of some fragility: > > > >> any('a', 'b,b', 'c').raku.substr(4, *-1).split(',').elems > > 4 > > > > I suppose you could do: > > > >> any('a', 'b,b', 'c').elems.raku.substr(4, *-1).split(',').elems > > 3 > > > > but I'm not sure that's _that_ much better than EVAL – either way, we're > > depending on the Str > > representation of inherently non-Str data, which seems like the main sin of > > EVAL. > > > > – codesections > > > > CAUTION - EXTERNAL EMAIL: This email originated outside the Judiciary. > Exercise caution when opening attachments or clicking on links.