develooper Front page | perl.perl6.users | Postings from June 2020

Re: junctions and parenthesis

Thread Previous | Thread Next
From:
Joseph Brenner
Date:
June 24, 2020 16:02
Subject:
Re: junctions and parenthesis
Message ID:
CAFfgvXWspE=aPMjz4rLFmfc1cy+W_noYieyq=7oVsQXyN6=Qpg@mail.gmail.com
> I would suggest calling .any on the list, that gives you just the tight preference you want; even if there were no .any method available on the object you've got, or you want a different function, you can <a b c>.&mysub

That's a good thought.  The code wouldn't read as nicely, though (the
syntax is less like English):

    say so <a b c>.any eq <c d>.any;

My solution would be just to always use parens on the junction functions:

    say so any(<a b c>) eq any(<c d>);




On 6/24/20, Timo Paulssen <timo@wakelift.de> wrote:
> On 22/06/2020 20:12, Joseph Brenner wrote:
>> > Speculating wildly: could there be a need for a different type of >
> function with different precedence?
> I would suggest calling .any on the list, that gives you just the tight
> preference you want; even if there were no .any method available on the
> object you've got, or you want a different function, you can <a b c>.&mysub
>
> LMKWYT
>   - Timo
>
>
>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About