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

Re: What's going on with "given (junction) {when (value)...}"

Thread Previous | Thread Next
Ralph Mellor
June 1, 2021 15:08
Re: What's going on with "given (junction) {when (value)...}"
Message ID:
On Tue, Jun 1, 2021 at 4:02 AM Larry Wall <> wrote:
> In my opinion, the most consistent approach is to disallow any
> autothreading of the argument to .ACCEPTS

That sounds like a really appropriate simplification as I write this.

> All those other smartmatches are sugar for .ACCEPTS, and
> should not introduce special cases either.

Sounds great.

> If you want to make use of a junction like that, you must write
>     when 3 ~~ $_ {...}
> or
>     when 3 == $_ {...}
> or so.



In the following, ALG = Applying Larry's Guidance.

Do we need an overhaul of .ACCEPTS methods wrt Any / Mu?
ALG would resolve this?

Range.ACCEPTS gets some things wrong
ALG would inform problem 1.

For the following ALG *might* be relevant but I haven't
thought things through at all.

Autothreading gone wrong?

Change in behavior when (starts-with|ends-with|substr-eq|contains)ing a Junction

using junctions in grep and split is inconsistent

Junctions don't autothread some methods correctly


If anyone wants to dig into one or more of those issues,
and decide whether Larry's guidance here is relevant to
them, and link to his guidance if so, that would be cool.

love, raiph

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About