On Sun, May 23, 2021 at 3:22 AM Joseph Brenner <doom...@gmail.com> wrote:
>
> > That is a large part of the beauty of the junction design. All functions
> > (and thus all operators) automatically get a very useful and powerful
> > junctional behavior for free. They don't even know junctions exist.
>
> I can see the point, of course. But then by the same token,
> function authors do need to think about junctions if it makes
> sense to do it the other way.

I'm not sure you've seen the point I hoped you'd see.

The point of the design as it is is that:

* *Users* of *junctions* should be willing to think about what
  they're doing when they *call* functions.

* *Authors* of *functions* should NOT *need* to think about
  junctions *unless they WANT to*. And they should think VERY
  carefully before introducing a DWIM, because for every DWIM
  there's one or more WATs.

> At least in this File::Find exclude case there doesn't
> seem to be anything useful about the current behavior.

As an overall set of points, Chinese Farmer always applies,
all these things are subject to our own perspectives, and
our perspectives change over time.

What follows is my current perspective.

The way it is now is consistent with what something like 99.9%
of all functions do. That has a *large* value all of its own.

While judicious DWIMs are considered a net positive in Raku
culture, injudicious ones are damaging. Here be dragons.

And what is the cost of leaving it as it is? There's a teachable
moment, one we're going through right now. That has value too.
And there are easy ways to express the same thing some other
way.

And what is the benefit of adding a DWIM? There's no great value.

If the sole justification for a DWIM is to whack a WAT, what about
new WATs?

Consider, for example, the DWIM added to `say` and cousins.

One can write `say 42 | 99` and get `any(42,99)`. That's a DWIM.
What `say` used to do was write `42` on one line and `99` on the
next. This is a WAT and the decision was to make `gist` special
case.

But at what cost? I currently think it was well worth the cost, but
there is a cost. Folk will then expect `say` to work like any other
function with junctions, but it's a special case.

I think there *is* another aspect that's worth discussing that isn't
a DWIM. I'll discuss that in another email.

--
love, raiph

Reply via email to