On Sat, Aug 15, 2009 at 10:15 AM, Brian Schott<[email protected]> wrote:
> Raul,
>
> Would your suggestions be met if instead of
> set =: ~.
> the definition were
> set =: (/:~)@~.
> ?

Yes, except elements of sets must be boxed,
so:

   set =: (/:~)@~...@boxxopen

> And if that were correct, would "your" definition of
>   realset =: 3 : 0
> s =. y
> for_k. i. >: L. y do. s =. sortset L:k s end.
> )
>
> be changed to
>
>   realset =: 3 : 0
> s =. y
> for_k. i. >: L. y do. s =. set L:k s end. NB. changed
> )
> ?

Well, I do not think realset should be used, in most
contexts.  However, for contexts where it's relevant
(where every box represents an element of a set), I
guess it would be

realset =: 3 :'for_k. >: i. L. y do. y =. set L:k y end.'

Note that this returns i.0 0 if given an argument which
is not a set.  I think that's appropriate.

> I think this would enable the system to "compare" more complicated
> sets like power sets, for example, whereas I am not sure how your
> apparent preference would permit such "compare"s. I am using "compare"
> in the sense that Kip combined u and n and iselementof.

I do not see the difficulty.

> My problem with sorting sets is that the user may have a good reason
> for the unsorted order of a set and sorting might disrupt that
> preference.

The only good reason I can think of would be cases where
the user is dealing with something which is not a set.  In
this case, the user should use the verb "set" to create the
appropriate set.

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to