I looked for dyadic examples of L: in the two main reference sources, the
DoJ and NuVoc.  The DoJ has none; NuVoc has one but I could not find where
the left argument, of the verb produced, is assigned.  I made an educated
guess (I hope) of the value that I missed.

These are the pair of arguments (beware of line-wrapping henceforward),

   (X=. <'abc';'def') (j=. ,&<) (Y=. 'AB';('CD';'EFG');<(<2 2$'HIJ';'K'))
┌───────────┬───────────────────────┐
│┌─────────┐│┌──┬────────┬─────────┐│
││┌───┬───┐│││AB│┌──┬───┐│┌───────┐││
│││abc│def││││  ││CD│EFG│││┌───┬─┐│││
││└───┴───┘│││  │└──┴───┘│││HIJ│K││││
│└─────────┘││  │        ││├───┼─┤│││
│           ││  │        │││HIJ│K││││
│           ││  │        ││└───┴─┘│││
│           ││  │        │└───────┘││
│           │└──┴────────┴─────────┘│
└───────────┴───────────────────────┘

This is the NuVoc example,

   X ,L:0 Y
┌─────────────┬──────────────┬─────────────────────────────┐
│┌─────┬─────┐│┌─────┬──────┐│┌─────────────┬─────────────┐│
││abcAB│defAB│││abcCD│defEFG│││┌──────┬────┐│┌──────┬────┐││
│└─────┴─────┘│└─────┴──────┘│││abcHIJ│abcK│││defHIJ│defK│││
│             │              ││├──────┼────┤│├──────┼────┤││
│             │              │││abcHIJ│abcK│││defHIJ│defK│││
│             │              ││└──────┴────┘│└──────┴────┘││
│             │              │└─────────────┴─────────────┘│
└─────────────┴──────────────┴─────────────────────────────┘

This is how their contents are paired,

   X j L:0 Y
┌───────────────────┬────────────────────┬──────────────────
───────────────────────┐
│┌────────┬────────┐│┌────────┬─────────┐│┌─────────────────
──┬───────────────────┐│
││┌───┬──┐│┌───┬──┐│││┌───┬──┐│┌───┬───┐│││┌─────────┬──────
─┐│┌─────────┬───────┐││
│││abc│AB│││def│AB│││││abc│CD│││def│EFG│││││┌───┬───┐│┌───┬─
┐│││┌───┬───┐│┌───┬─┐│││
││└───┴──┘│└───┴──┘│││└───┴──┘│└───┴───┘│││││abc│HIJ│││abc│
K│││││def│HIJ│││def│K││││
│└────────┴────────┘│└────────┴─────────┘│││└───┴───┘│└───┴─
┘│││└───┴───┘│└───┴─┘│││
│                   │                    ││├─────────┼───────┤│├───────
──┼───────┤││
│                   │                    │││┌───┬───┐│┌───┬─┐│││┌───┬──
─┐│┌───┬─┐│││
│                   │                    ││││abc│HIJ│││abc│K│││││def│
HIJ│││def│K││││
│                   │                    │││└───┴───┘│└───┴─┘│││└───┴──
─┘│└───┴─┘│││
│                   │                    ││└─────────┴───────┘│└───────
──┴───────┘││
│                   │                    │└───────────────────┴────────
───────────┘│
└───────────────────┴────────────────────┴──────────────────
───────────────────────┘

 Given that levels of X and Y are,

   L. L:_1 X j Y
┌─┬─┐
│2│3│
└─┴─┘

Two examples of how the contents are paired for negative levels of the
current specification of L: follow,

   X j L:_1 Y  NB. Same as X j L: 1 2 Y
┌──────────────┬────────────────────┬─────────────────────┐
│┌─────────┬──┐│┌─────────┬────────┐│┌─────────┬─────────┐│
││┌───┬───┐│AB│││┌───┬───┐│┌──┬───┐│││┌───┬───┐│┌───────┐││
│││abc│def││  ││││abc│def│││CD│EFG│││││abc│def│││┌───┬─┐│││
││└───┴───┘│  │││└───┴───┘│└──┴───┘│││└───┴───┘│││HIJ│K││││
│└─────────┴──┘│└─────────┴────────┘││         ││├───┼─┤│││
│              │                    ││         │││HIJ│K││││
│              │                    ││         ││└───┴─┘│││
│              │                    ││         │└───────┘││
│              │                    │└─────────┴─────────┘│
└──────────────┴────────────────────┴─────────────────────┘

and

   X j L:_1 _3 Y  NB. Same as X j L: 1 0 Y
┌──────────────┬────────────────────────────────┬───────────
──────────────────────┐
│┌─────────┬──┐│┌──────────────┬───────────────┐│┌──────────
─────────────────────┐│
││┌───┬───┐│AB│││┌─────────┬──┐│┌─────────┬───┐│││┌─────────
──────┬─────────────┐││
│││abc│def││  ││││┌───┬───┐│CD│││┌───┬───┐│EFG│││││┌─────────┬───┐│┌─────
────┬─┐│││
││└───┴───┘│  │││││abc│def││  ││││abc│def││   ││││││┌───┬───┐│HIJ│││┌───┬──
─┐│K││││
│└─────────┴──┘│││└───┴───┘│  │││└───┴───┘│   │││││││abc│def││
 ││││abc│def││ ││││
│              ││└─────────┴──┘│└─────────┴───┘│││││└───┴───┘│
 │││└───┴───┘│ ││││
│              │└──────────────┴───────────────┘│││└─────────┴───┘│└───────
──┴─┘│││
│              │
││├───────────────┼─────────────┤││
│              │
│││┌─────────┬───┐│┌─────────┬─┐│││
│              │
││││┌───┬───┐│HIJ│││┌───┬───┐│K││││
│              │                                │││││abc│def││
 ││││abc│def││ ││││
│              │                                ││││└───┴───┘│
 │││└───┴───┘│ ││││
│              │
│││└─────────┴───┘│└─────────┴─┘│││
│              │
││└───────────────┴─────────────┘││
│              │
│└───────────────────────────────┘│
└──────────────┴────────────────────────────────┴───────────
──────────────────────┘

I hope this helps to provide at least some intuition for the dyadic case
with negative levels.


On Sun, Jul 29, 2018 at 11:58 PM, Jose Mario Quintana <
jose.mario.quint...@gmail.com> wrote:

> > It would be enlightening to all of us (or just me) if someone could
> point out an exception to the heuristic, or provide a more accurate one.
>
>
> Consider the following right argument,
>
>    Y=. 5!:2@:<'toJ'
>
> the next sentence just echoes the arguments taken by the verb ([echo) and
> reproduces Y,
>
>    ([echo) L:_2 Y
>
>
> ┌─────────────────────┬─┐
> │┌───────────────┬─┬─┐│}│
> ││┌──┬─┬────────┐│@│]││ │
> │││I.│@│┌──┬─┬─┐││ │ ││ │
> │││  │ ││e.│&│ │││ │ ││ │
> │││  │ │└──┴─┴─┘││ │ ││ │
> ││└──┴─┴────────┘│ │ ││ │
> │└───────────────┴─┴─┘│ │
> └─────────────────────┴─┘
> ]
> @:
> ┌─────┬──────────────────────┐
> │┌─┬─┐│┌──┬─┬───────────────┐│
> ││#│~│││-.│@│┌─────────┬─┬─┐││
> │└─┴─┘││  │ ││┌──┬─┬──┐│@│,│││
> │     ││  │ │││  │&│E.││ │ │││
> │     ││  │ ││└──┴─┴──┘│ │ │││
> │     ││  │ │└─────────┴─┴─┘││
> │     │└──┴─┴───────────────┘│
> └─────┴──────────────────────┘
> ┌───────────────────────────────┬──┬──────────────────────────────┐
> │┌─┬─────────────────────────┬─┐│@:│┌─────┬──────────────────────┐│
> ││ │┌─────────────────────┬─┐│]││  ││┌─┬─┐│┌──┬─┬───────────────┐││
> ││ ││┌───────────────┬─┬─┐│}││ ││  │││#│~│││-.│@│┌─────────┬─┬─┐│││
> ││ │││┌──┬─┬────────┐│@│]││ ││ ││  ││└─┴─┘││  │ ││┌──┬─┬──┐│@│,││││
> ││ ││││I.│@│┌──┬─┬─┐││ │ ││ ││ ││  ││     ││  │ │││  │&│E.││ │ ││││
> ││ ││││  │ ││e.│&│ │││ │ ││ ││ ││  ││     ││  │ ││└──┴─┴──┘│ │ ││││
> ││ ││││  │ │└──┴─┴─┘││ │ ││ ││ ││  ││     ││  │ │└─────────┴─┴─┘│││
> ││ │││└──┴─┴────────┘│ │ ││ ││ ││  ││     │└──┴─┴───────────────┘││
> ││ ││└───────────────┴─┴─┘│ ││ ││  │└─────┴──────────────────────┘│
> ││ │└─────────────────────┴─┘│ ││  │                              │
> │└─┴─────────────────────────┴─┘│  │                              │
> └───────────────────────────────┴──┴──────────────────────────────┘
>
> The equivalent form, according to the DoJ does the same,
>
>    ([echo) L:(0>.(L.Y)-2) Y
>
>
> ┌─────────────────────┬─┐
> │┌───────────────┬─┬─┐│}│
> ││┌──┬─┬────────┐│@│]││ │
> │││I.│@│┌──┬─┬─┐││ │ ││ │
> │││  │ ││e.│&│ │││ │ ││ │
> │││  │ │└──┴─┴─┘││ │ ││ │
> ││└──┴─┴────────┘│ │ ││ │
> │└───────────────┴─┴─┘│ │
> └─────────────────────┴─┘
> ]
> @:
> ┌─────┬──────────────────────┐
> │┌─┬─┐│┌──┬─┬───────────────┐│
> ││#│~│││-.│@│┌─────────┬─┬─┐││
> │└─┴─┘││  │ ││┌──┬─┬──┐│@│,│││
> │     ││  │ │││  │&│E.││ │ │││
> │     ││  │ ││└──┴─┴──┘│ │ │││
> │     ││  │ │└─────────┴─┴─┘││
> │     │└──┴─┴───────────────┘│
> └─────┴──────────────────────┘
> ┌───────────────────────────────┬──┬──────────────────────────────┐
> │┌─┬─────────────────────────┬─┐│@:│┌─────┬──────────────────────┐│
> ││ │┌─────────────────────┬─┐│]││  ││┌─┬─┐│┌──┬─┬───────────────┐││
> ││ ││┌───────────────┬─┬─┐│}││ ││  │││#│~│││-.│@│┌─────────┬─┬─┐│││
> ││ │││┌──┬─┬────────┐│@│]││ ││ ││  ││└─┴─┘││  │ ││┌──┬─┬──┐│@│,││││
> ││ ││││I.│@│┌──┬─┬─┐││ │ ││ ││ ││  ││     ││  │ │││  │&│E.││ │ ││││
> ││ ││││  │ ││e.│&│ │││ │ ││ ││ ││  ││     ││  │ ││└──┴─┴──┘│ │ ││││
> ││ ││││  │ │└──┴─┴─┘││ │ ││ ││ ││  ││     ││  │ │└─────────┴─┴─┘│││
> ││ │││└──┴─┴────────┘│ │ ││ ││ ││  ││     │└──┴─┴───────────────┘││
> ││ ││└───────────────┴─┴─┘│ ││ ││  │└─────┴──────────────────────┘│
> ││ │└─────────────────────┴─┘│ ││  │                              │
> │└─┴─────────────────────────┴─┘│  │                              │
> └───────────────────────────────┴──┴──────────────────────────────┘
>
> The levels down of the leaves of Y correspond to
>
>    $L:1 {:: Y
> ┌─────────────────────────────┬─┬───────────────────────────┐
> │┌─┬───────────────────────┬─┐│1│┌─────┬───────────────────┐│
> ││2│┌───────────────────┬─┐│2││ ││┌─┬─┐│┌─┬─┬─────────────┐││
> ││ ││┌─────────────┬─┬─┐│3││ ││ │││3│3│││3│3│┌───────┬─┬─┐│││
> ││ │││┌─┬─┬───────┐│4│4││ ││ ││ ││└─┴─┘││ │ ││┌─┬─┬─┐│4│4││││
> ││ ││││5│5│┌─┬─┬─┐││ │ ││ ││ ││ ││     ││ │ │││5│5│5││ │ ││││
> ││ ││││ │ ││6│6│6│││ │ ││ ││ ││ ││     ││ │ ││└─┴─┴─┘│ │ ││││
> ││ ││││ │ │└─┴─┴─┘││ │ ││ ││ ││ ││     ││ │ │└───────┴─┴─┘│││
> ││ │││└─┴─┴───────┘│ │ ││ ││ ││ ││     │└─┴─┴─────────────┘││
> ││ ││└─────────────┴─┴─┘│ ││ ││ │└─────┴───────────────────┘│
> ││ │└───────────────────┴─┘│ ││ │                           │
> │└─┴───────────────────────┴─┘│ │                           │
> └─────────────────────────────┴─┴───────────────────────────┘
>
> It interesting to note that the level down 2 branch,
>
>    (0;1) {:: Y
> ┌─────────────────────┬─┐
> │┌───────────────┬─┬─┐│}│
> ││┌──┬─┬────────┐│@│]││ │
> │││I.│@│┌──┬─┬─┐││ │ ││ │
> │││  │ ││e.│&│ │││ │ ││ │
> │││  │ │└──┴─┴─┘││ │ ││ │
> ││└──┴─┴────────┘│ │ ││ │
> │└───────────────┴─┴─┘│ │
> └─────────────────────┴─┘
>
> is echoed; however, the level down 2 branch,
>
>    (2;0) {:: Y
> ┌─┬─┐
> │#│~│
> └─┴─┘
>
> is not echoed.
>
> If I had to verbalize the monadic case of L: for a negative (right)
> argument (-r) I would base it on the equivalent form (L:(0>.(L.Y)-r),
> assuming that it always hols); for example,
>
> It is the level at (L:) the maximum between 0 and the difference between
> the level (L.) of the argument (Y) of the verb produced (u L:(-r)) and the
> absolute value of its right argument (-r).
>
> At any rate, for what is worth, I agree with your biggest point.
>
>
> On Sun, Jul 29, 2018 at 5:51 PM, 'Pascal Jasmin' via Programming <
> programm...@jsoftware.com> wrote:
>
>>
>>
>> so L:_2 would be "one level down from  top level".  Its not quite the
>> same as "double each"
>>
>> $&.>&.> t
>>
>> ┌──┬───────┐
>>
>> │┌┐│┌─┬─┬─┐│
>>
>> │││││3│2│2││
>>
>> │└┘│└─┴─┴─┘│
>>
>> └──┴───────┘
>>
>> I would verbalize that as "at -2 levels or operate on null"
>>
>> regarding: " if there is an appropriate "-2" level then apply there, else
>> apply at maximum depth."
>>
>> that feels like the current interpretation, and certainly if I have an
>> urge to apply the above heuristic, then L:_2 is what I would try.
>>
>> It would be enlightening to all of us (or just me) if someone could point
>> out an exception to the heuristic, or provide a more accurate one.
>>
>> I'd say my biggest point is that if you want a version of L: (and I think
>> such a version is very useful) that leaves "levels" unchanged/unprocessed
>> if they do not exist, then something like L:: (a new definition) is
>> worthwhile.
>>
>>
>>
>> On Sunday, July 29, 2018, 5:29:57 p.m. EDT, Henry Rich <
>> henryhr...@gmail.com> wrote:
>>
>>
>>
>>
>>
>> " if there is an appropriate "-3" level then apply there, else apply at
>> maximum depth."
>>
>> As a rule describing current behavior, this is wrong.  It suffers from a
>> couple of undefined terms: (1) what is -3 level? (2) what is maximum
>> depth?
>>
>> If -3 level means "3 levels down from the top" (or equivalently
>> "enclosed by 3 boxes"), it has a more serious problem: the system
>> doesn't do that currently.
>>
>> Henry Rich
>>
>> On 7/29/2018 5:22 PM, 'Pascal Jasmin' via Programming wrote:
>> >
>> >  From your wiki entry, this is the current behaviout:
>> >
>> > $L:_3 t
>> >
>> > ┌─┬─────────────┐
>> >
>> > │1│┌───────┬─┬─┐│
>> >
>> > │ ││┌─┬─┬─┐│2│2││
>> >
>> > │ │││3│1│2││ │ ││
>> >
>> > │ ││└─┴─┴─┘│ │ ││
>> >
>> > │ │└───────┴─┴─┘│
>> >
>> > └─┴─────────────┘
>> >
>> > which is quite reasonable: " if there is an appropriate "-3" level then
>> apply there, else apply at maximum depth."
>> >
>> > The behaviour to leave unchanged if "no such level exists" is useful,
>> but perhaps a new primitive "L::" would be the appropriate path.
>> >
>> > L::2 would also leave items that do not have such depth unchanged.
>> >
>> > There doesn't seem to be a "magic reason" for negative n argument to
>> have different behaviour.
>> >
>> >
>> >
>> > On Saturday, July 28, 2018, 7:42:39 p.m. EDT, Henry Rich <
>> henryhr...@gmail.com> wrote:
>> >
>> >
>> >
>> >
>> >
>> > L:, especially the dyad, is so complicated already that it's not worth
>> > changing if complex arguments are needed.
>> >
>> > It would be pretty simple to look through your code for for L:_,
>> > wouldn't it?  Do you have more than one occurrence?  Could you replace
>> > the level with a positive constant or a negative constant under the new
>> > definition?
>> >
>> > As you well know, J has a history of making incompatible changes if they
>> > are improvements to the language.
>> >
>> > Henry Rich
>> >
>> > On 7/28/2018 7:11 PM, Jose Mario Quintana wrote:
>> >> I have, at least, produced code which includes L:_1 in a context in
>> which
>> >> it is not equivalent to &.>.
>> >>
>> >> Have you considered to get what you want without potentially breaking
>> >> existing code (e.g., giving meaning to imaginary whole numbers for the
>> >> right argument of L:)?
>> >>
>> >> (It seems that you wrote L" instead of L: a couple of times in the
>> >> description of your proposal.)
>> >>
>> >> On Fri, Jul 27, 2018 at 3:29 PM, Henry Rich <henryhr...@gmail.com>
>> wrote:
>> >>
>> >>> I think negative level is wrongly defined.  (u L:(-r) y)  applies u at
>> >>> level ((L. y) -r), which measures from the bottom of the tree.  What
>> I want
>> >>> is a form that applies u two levels down, say, which I can't get
>> now.  I
>> >>> propose to change L: to do what I want.
>> >>>
>> >>> Has anyone found a use for L:(-r) using the current definition?
>> >>>
>> >>> My proposed change is described at https://code.jsoftware.com/wik
>> >>> i/System/Interpreter/Requests#Change_definition_of_negative_
>> >>> level_.28strawman.29
>> >>>
>> >>> Henry Rich
>> >>>
>> >>> ---
>> >>> This email has been checked for viruses by AVG.
>> >>> https://www.avg.com
>> >>>
>> >>> ------------------------------------------------------------
>> ----------
>> >>> For information about J forums see http://www.jsoftware.com/forum
>> s.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
>> > ----------------------------------------------------------------------
>> > 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
>>
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to