I hope I was not misunderstood. I was thinking, this is a nice way to do it, and I know another nice way to do it.
"Nice" here could mean "short", as measured by #@;:@(5!:5) , except that gives an unfair edge to explicit verbs, many of which are only three words long! The puzzle remains to find other nice ways to implement union u and intersection n . Matthew Brand wrote: > Define nice. > > 2009/7/16 Kip Murray <[email protected]>: >> Good, and there is at least one other nice way to do it. >> >> Matthew Brand wrote: >>> u =. ~.@, >>> n =. ~.@(e.#[) >>> 1 2 3 4 u 3 4 5 6 >>> 1 2 3 4 5 6 >>> 1 2 3 4 n 3 4 5 6 >>> 3 4 >>> >>> >>> >>> 2009/7/16 Kip Murray <[email protected]>: >>>> The following is easy but interesting. >>>> >>>> A "set" is a numeric vector without repetitions. Provide definitions for >>>> the >>>> union u and intersection n of two sets: >>>> >>>> 1 2 3 4 u 3 4 5 6 NB. elements of one or the other >>>> 1 2 3 4 5 6 >>>> >>>> 1 2 3 4 n 3 4 5 6 NB. common elements >>>> 3 4 >>>> >>>> ---------------------------------------------------------------------- >>>> 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
