To help illustrate, $ (0 1$ 3) + 3 0 1 +/ (0 1$ 3) 0 +/ (0 1$ 3) + 3 0 +/ (0 3$ 3) NB. I would prefer that this return 0 0 0 0 $ +/"1 (0 3$ 3) 0
It would greatly enhance the "do what I mean" value of J if dyads leveraged identity functions the same way that the / adverb does. I would also propose that (0 n $ y1) -: 0 0 $ y2 and (0 m n $ y1) -: 0 0 0 $ y2 basically converting (internally) any shapes with leading axis of 0 to all 0 shapes of the same rank. Because all of the above expressions have the same absense of any data, any information beyond its rank (number of shapes) is irrelevant, and only complicates (hinders) comparisons or (compositions with future calculations) to their (equivalent but simplified) concept. I would suggest that the distinction between (0 n $ y1) and 0 0 $ y1 never provides any value and always "gets in the way". ----- Original Message ---- From: Roger Hui <[EMAIL PROTECTED]> To: Programming forum <[email protected]> Sent: Sunday, October 22, 2006 11:48:51 AM Subject: Re: [Jprogramming] Dyads and identity function (0$0) u y and x u (0$0) ARE defined, but it's not what you think. For the atomic verbs (of which + is one), the shape of the result is the shape of the argument with greater rank. When one argument is an atom, that is, has rank 0, the smallest possible rank, then the shape of the result is necessarily the shape of the other argument. ----- Original Message ----- From: Pascal Jasmin <[EMAIL PROTECTED]> Date: Sunday, October 22, 2006 7:59 am Subject: [Jprogramming] Dyads and identity function > At the bottom of this essay, there is discussion about identity > functions and how they interact with the / adverb. > http://www.jsoftware.com/jwiki/PascalJasmin/nil_and_empty_in_J > > > +/ (i.0) , i.0 > 0 > */ (i.0) , i.0 > 1 > (+/ (i.0) , i.0) -: +/ i.0 > 1 > > if u/ 0$0 is defined, then so should (0$0) u y or x u 0$0 or (0$0) > u 0$0. > the equivalent definitions are: (u/ (0$0)) u y and x u u/ 0$0 and > (u/ 0$0) u u/ 0$0 > > currently x + empty returns empty: > $ 3 + i.0 > 0 > +/ 3 > 3 > > which doesn't make sense if an identity function has been defined > for + ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
