That ^:L. is a good idea, one that I would have used a few times if I'd
thought of it.

FYI:  L. by itself is usually a mistake. It recurs through all boxing to
the bitter end. Better to use (0 < L.) which allows early exit.

Henry Rich

On Sat, Dec 16, 2023, 7:36 PM Raul Miller <rauldmil...@gmail.com> wrote:

> I've also used  U^:L.L:1 when dealing with that kind of data structure
> where I only wanted to act on the part that's deeply nested.
>
>    !L:0^:L.L:1 (<0 1 2),<2 4;3 5 7
> ┌─────┬─────────────────┐
> │0 1 2│┌────┬──────────┐│
> │     ││2 24│6 120 5040││
> │     │└────┴──────────┘│
> └─────┴─────────────────┘
>
> You can see a more interesting example in the implementation of disp
> at
> https://code.jsoftware.com/wiki/Essays/RegularExpressions/NondeterministicFiniteAutomata
>
> FYI,
>
> --
> Raul
>
> On Sat, Dec 16, 2023 at 7:18 PM 'Nollaig MacKenzie' via General
> <gene...@jsoftware.com> wrote:
> >
> > I like L: a lot. You can do neat things:
> >
> >    ! L: 0 (<0 1 2),<2 4;3 5 7
> > ┌─────┬─────────────────┐
> > │1 1 2│┌────┬──────────┐│
> > │     ││2 24│6 120 5040││
> > │     │└────┴──────────┘│
> > └─────┴─────────────────┘
> >
> >
> > > On Dec 16, 2023, at 09:09, Henry Rich <henryhr...@gmail.com> wrote:
> > >
> > > 'prefix' ,L:0 names
> > >
> > > Untested.
> > >
> > > Henry Rich
> > >
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to