I think we have agreed that (32 = 3!:0) tests whether y is boxed.  The original 
issue was the behavior of Link ; when the right argument is an empty list of 
boxes:

     E =: 0$<1
     3!:0 E  NB. E is boxed:
32
     1;E
+-++
|1||
+-++
     (<1),E
+-+
|1|
+-+


The Dictionary:

x;y is (<x),y if y is boxed, and (<x),<y if y is open.


My interest:

Properties of E as the empty set, where "set" is modeled as a sorted list of
boxes, without repetitions, and "element" is the array contained in a box.

     IsSet =: [: *./ (-: /:~),(-: ~.),(1 = #...@$),(32 = 3!:0)

     IsSet E
1


bill lam wrote:
> On Tue, 28 Jul 2009, Dan Bron wrote:
>> Kip Murray wrote:
>>>    E =: 0$<1
>>>    3!:0 E  NB. E is boxed:
>>> 32
>>>
>> Raul responded:
>>>    L.E
>>> 0
>> To be explicit, Raul's suggesting you change your test for "is boxed".  A
>> common test for "is boxed" in J is  (0<L.)  .  So you could rewrite your 
>>
> 
> I think both tests are useful depending on context. From DOJ
> 
> If y is open or empty, L. y is 0; if it is boxed and
> non-empty, the level is one plus the maximum of the
> levels of the opened elements.
> 
> So that L. tests for both empty and box. If it is known or assumed to
> be non-empty, then using L. will require less typing.
> 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to