> Why does it matter to you? Because an empty list of boxes is different from an empty list of numbers, and code can work or not work depending on which result is produced by , .
Also, the behavior as described below violates the principle of J that the user doesn't need to concern himself with the type of numbers. As implemented, a complex list produces numbers, while an integer list produces boxes. It is very important that empties be handled consistently, and not just by pretending that the type doesn't matter, so that code doen't have to check for empty operands. Henry Rich > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Roger Hui > Sent: Thursday, October 19, 2006 9:15 AM > To: Programming forum > Subject: Re: [Jprogramming] data type of empty , empty > > > > > ----- Original Message ----- > From: bill lam <[EMAIL PROTECTED]> > Date: Wednesday, October 18, 2006 6:56 pm > Subject: [Jprogramming] data type of empty , empty > > > I tested appending empty to empty of different data types. > > (3!:0) (0$0) , 0$0 > > 1 > > (3!:0) (0$0) , 0$' ' > > 2 > > (3!:0) (0$2) , 0$' ' > > 4 > > (3!:0) (0$2.2) , 0$' ' > > 8 > > (3!:0) (0$u:'a') ,~ 0$a: > > 131072 > > (3!:0) (0$u:'a') , 0$a: > > 131072 > > (3!:0) (0$' ') ,~ 0$a: > > 32 > > (3!:0) (0$1r3) , 0$a: > > 128 > > (3!:0) (0$0) , 0$a: > > 32 > > (3!:0) (0$2) , 0$a: > > 32 > > (3!:0) (0$2.2) , 0$a: > > 8 > > (3!:0) (0$1j2) , 0$a: > > 16 > > > > At first, I thought data type is the larger of 3!:0, but a counter > > example in > > the last line. It also seems data type does not depend on leftmost > > or rightmost > > position. Does anyone know the rule of deriving the data type? > > > ---------------------------------------------------------------------- > For information about J forums see > http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
