testSet =: (1; ((3,4); 8; (8,9)); 10) 0 } testSet returns a boxed 1 2 } testSet returns a boxed 10 1 } testSet returns a boxed ((3 4); 8; (8 9))
I would have expected the last set returned to have a rank of 3 and not a rank of 1. I would like to do 1 } ( 1 } testSet ) to get 8, but get an index error because # (1 } testSet) is rank of 1 I need to choose a set from within a set and then extract a member from within the set I extracted. ----- Original Message Follows ----- From: [email protected] To: Programming forum <[email protected]> Subject: Re: [Jprogramming] sets within a set Date: Thu, 16 Jul 2009 15:17:51 -0800 > { 1, { { 3, 4}, 8, { 8, 9}}, 10} in J is: > >1; ((3,4); 8; (8,9)); 10 > >thanks again for the help > >----- Original Message Follows ----- >From: [email protected] >To: Programming forum <[email protected]> >Subject: Re: [Jprogramming] sets within a set >Date: Thu, 16 Jul 2009 14:53:28 -0800 > >>In general a set is a combination of elements or a set. >> >>Any set within a set can contain either elements or sets. >> >>How would boxed notation be used to represent something >>like: >> >>{ 1, { { 3, 4}, 8, { 8, 9}}, 10} >> >>----- Original Message Follows ----- >>From: [email protected] >>To: Programming forum <[email protected]> >>Subject: Re: [Jprogramming] sets within a set >>Date: Thu, 16 Jul 2009 14:35:05 -0800 >> >>>setLess =:: -. [ >>> >>>1 2 3 4 setLess 1 4 >>>2 3 >>> >>>so, >>> >>>1; 2; 3; 4 setLess 1; 4 >>> >>>should return boxed >>>2 3 >>> >>>but it returns >>>boxed 1 2 3 4 >>> >>>and in my math notation >>> >>>{ 1, { 2, 3 }, 3 } setLess { 2, 3 } should return { 1, 3 >>>} { 1, { 2, 3 }, 3 } setLess { 3 } should return { 1, >>>{2 , 3}} >>> >>> >>> >>> >>> >>> >>>----- Original Message Follows ----- >>>From: Raul Miller <[email protected]> >>>To: Programming forum <[email protected]> >>>Subject: Re: [Jprogramming] sets within a set >>>Date: Thu, 16 Jul 2009 15:52:48 -0400 >>> >>>>On Thu, Jul 16, 2009 at 3:49 PM, >>>>> <[email protected]> wrote: A =: 1 2 3 4 >>>>> B =: 10 20 30 40 >>>>> C =: 100 200 300 400 >>>>> >>>>> How would one define the set: >>>>> bigSet =: 0.5 A B C 1000.5 >>>>> in such a way that the cardinality, that is '# bigSet' >>>>is 5 >>>> >>>> bigSet=: 0.5;A;B;C;1000.5 >>>> >>>>-- >>>>Raul >>>>-------------------------------------------------------- >>>>- - - ----------- 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
