On Sat, Oct 30, 2021 at 8:38 PM Sean McAfee <eef...@gmail.com> wrote:
>
> It worked!  But I couldn't quite see how.
>
> Anyway, pretty cool!

I agree it's cool, at least in a golfing sense.

But is your explanation right?

The *range* operator (`..`), if the rhs is less than the left,
yields an empty list rather than iterating between the endpoints.

In contrast, the *sequence* operator (`...`) iterates.

So, in code:

say [*];        # 1
say [*]  ();    # 1
say list 1..0;  # ()
say [*]  1..0;  # 1

say list 0..1;  # (0 1)
say [*]  0..1;  # 0

say list 1...0; # (1 0)
say [*]  1...0; # 0
say list 0...1; # (0 1)
say [*]  0...1; # 0

--
love, raiph

Reply via email to