Note that the -:each would have resulted in a length error.

Roger Hui wrote:
In addition to "el" vs. "one", another way
this can happen is a 1-row matrix vs. a list.
$ each   would be more informative than   # each .



----- Original Message -----
From: "Philip A. Viton" <[EMAIL PROTECTED]>
Date: Wednesday, August 22, 2007 11:51
Subject: [Jprogramming] why are these different?
To: [email protected]

Can someone help me understand why this is going wrong here? I've been staring at it for half an hour and can't figure it out. Basically, I need to understand how to discover what the difference is between two variables, denoted y and yy. In the failing application, under debug I see

y n 2$(<5$'year1'),(<4$'year')

I don't think I can get a similar report for the global yy.


Thanks for any suggestions!

------------------- transcript

       z
+--------------+
¦wts¦year¦yearl¦
+--------------+

       y
+----------+
¦year1¦year¦
+----------+

       yy
+----------+
¦yearl¦year¦
+----------+


z i. yy NB. this works!
2 1


z i. y NB. this doesn't, for the zero'th element
3 1

NB. at this point I'm trying to test whether y and yy are the same

       #each y
+---+
¦5¦4¦
+---+
       #each yy
+---+
¦5¦4¦
+---+


       3!:0 y
32
       3!:0 yy
32

NB.  but J thinks they're different

       y -: yy
0

       y -: each yy
+---+
¦0¦1¦
+---+
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


--
------------------------------------------------------------------------
|\/| Randy A MacDonald       | APL: If you can say it, it's done.. (ram)
|/\| ramacd <at> nbnet.nb.ca |
|\ |                         | The only real problem with APL is that
BSc(Math) UNBF'83            | it is "still ahead of its time."
Sapere Aude                  |     - Morten Kromberg
Natural Born APL'er          |
-----------------------------------------------------(INTP)----{ gnat }-



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to