I should add, that you should try replacing the leading 0 in 0 $ with other digits, to get a better feel for the logic of these cases:
When you are working on the structure within the item, 1 $ gives you the first element of the item, 2 $ gives you the unmodified item and 3 $ gives you a fatter item, and here's the 4 $ case: (i.2 2),~ 4$0{i.6 2 0 1 0 1 0 1 0 0 2 3 0 0 (four numbers in your new item). When you are working on the item itself, 1 $ gives you one copy of it, 2 $ gives you two copies of it, and 3 $ gives you three copies of it, and here is how 4 $ works: (i.2 2),~ 4$,:0{i.6 2 0 1 0 1 0 1 0 1 0 1 2 3 (four extra copies of your item) This would be even clearer if instead of 0 { you had used 2 { ... -- Raul On Mon, Jan 14, 2013 at 7:24 AM, Raul Miller <rauldmil...@gmail.com> wrote: > I do not see any use of take ({.) here, so I am a bit confused by your > explanation. > > You do have 0 { i. 6 2 but that is not a 'take', that is a 'from'. If > you want the result of 'from' to be items, you need to either make > sure its left argument is rank 1 or you need to adjust the rank of the > result. In this case, where your left argument to from is rank 0, you > can use ,: to give your result the appropriate rank. > > In other words: > > (i.2 2),~ 0$0{i.6 2 > > Here, 0 $ is removing the content of your item not the item itself > > (i.2 2),~ 0$,: 0{i.6 2 > > Here, 0 $ is removing the item. > > (i.2 2),~ 0$(,0){i.6 2 > > And, here, also, 0 $ is removing the item. > > -- > Raul > > On Mon, Jan 14, 2013 at 4:38 AM, Steven Taylor <tayl...@gmail.com> wrote: >> thanks for the 0 0$0 comment idea. >> >> the bit that caught me was where an empty take comes back as 0 $ 0 from >> take. The sequence was a little like this. >> >> (i.2 2),~ 0$0{i.6 2 >> 0 0 >> 0 1 >> 2 3 >> >> Just trying to keep it as tacit as possible. i.e. 0$0 could be a list of >> zero or more indices. >> >> >> On 13 January 2013 21:23, Raul Miller <rauldmil...@gmail.com> wrote: >> >>> Note that (0 0$0), i. 2 2 would also work. The trailing dimension >>> gets expanded, just like in your original case, so the net result is >>> equivalent to (0 2$0,i. 2 2 which is to say nothing happens. >>> >>> But, depending on your situation, 0 0 $ 0 might be more generally >>> useful than 0 2 $ 0. >>> >>> FYI, >>> >>> -- >>> Raul >>> >>> p.s. sorry about the hijacking >>> >>> On Sun, Jan 13, 2013 at 4:05 PM, Steven Taylor <tayl...@gmail.com> wrote: >>> > I think the email thread got hijacked... but a follow up to the original >>> > join question... >>> > >>> > Roger pointed out that I wasn't being logical (i.e. appending rank 1 to >>> > rank 2 doesn't make sense). >>> > >>> > ... and if I do this, I now get back what I expected to see. >>> > >>> > (0 2$0), i.2 2 >>> > 0 1 >>> > 2 3 >>> > >>> > So... I borrowed the idea of q's "reshape" and implemented it in J as a >>> > helper verb. So far, it seems to be doing the trick. >>> > >>> > thanks for the comments and help. >>> > >>> > >>> > On 13 January 2013 02:19, Raul Miller <rauldmil...@gmail.com> wrote: >>> > >>> >> On Sat, Jan 12, 2013 at 8:50 PM, Linda Alvord <lindaalv...@verizon.net> >>> >> wrote: >>> >> > As long as the ranks agree, u&v y -> u v y >>> >> > >>> >> > Would this be useful as a definition of compose? >>> >> >>> >> That is the definition for the monadic case but is incomplete since it >>> >> does not mention the dyadic case. >>> >> >>> >> But note also that the dictionary's vocabulary is a reference work and >>> >> it has already stated that the ranks must agree. Keep in mind that >>> >> the dictionary also includes material such as >>> >> http://www.jsoftware.com/help/dictionary/samp13.htm >>> >> >>> >> FYI, >>> >> >>> >> -- >>> >> 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