Hopefully you have figured out by now that e. does not require that
ranks match exactly:

   1 e. 1
1
   1 e. 1 2 3
1
   #$1
0
   #$1 2 3
1

Basically, e. is looks for items in its left hand argument matching
items in its right hand argument. Normally, items have a rank 1 less
than the rank of the noun, but if the noun is rank 0 it is treated as
a single item.

It's better to use -: than e. if you want to test for matching rank.

Thanks,

-- 
Raul


On Sun, Dec 24, 2017 at 6:12 PM, Nick S <[email protected]> wrote:
> I worried about that, but the read is completing.  I think that "within a
> script" would mean that if I had immediate code in an ijs file I can't
> pause the load to read from the keyboard.
>
> I understand the point, and the fix worked.  But I thought I had tested for
> rank mismatch when I did this:
>
>   (1!:1 (1)) e. 'e'
>
> e
>
> 1
>
>
> also
>
>
>
>    (,'e') e 'e'
>
> 1
>
>    ('e') e. ,'e'
>
> 1
>
>
> And I have a whole bunch more .e stuff that works whether the left or right
> arguments are
>
> scalar or length 1 vectors but then I reread the documentation (for like
> the fourth time, that was where I first got that it used .e) and it boxes
> your terms if they are
>
> not boxed.
>
>
> boxifopen=:<^:(L.=0:)
>
>
>    ('e') e.&boxifopen 'e'
>
> 1
>
> (,'e') e.&boxifopen 'e'
>
> 0
>
>  (,'e') e.&boxifopen ,'e'
>
> 1
>
> The fix works.  I guess I didn't expect .e to treat things in boxes
> differently than it would treat immediate terms, other than unboxing them.
> So this has nothing to do with select one way or the other.  Sigh.  Thanks
> for the help again.
> --
> Of course I can ride in the carpool lane, officer.  Jesus is my constant
> companion.
> ----------------------------------------------------------------------
> 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