Yes it is, remember J is origin 0. [-.5] puts things together with a new leading axis. If origin is 1 (APL) you would then use [.5]


On Sat, 14 Jun 2008, Randy MacDonald wrote:

No, it isn't.

Roger Hui wrote:
x,[_0.5] y in APL is equivalent to x,:y in J.



----- Original Message -----
From: PackRat <[EMAIL PROTECTED]>
Date: Thursday, June 12, 2008 6:11
Subject: [Jprogramming] Bracket APL-to-J question
To: Programming forum <[email protected]>


I wasn't sure which forum was the best for this kind of APL-to-J programming question, so I thought I'd try it here. If that's not correct, please let me know, so that I can submit any future questions along this line to the appropriate forum.

I have a master's degree in music, and one of the main reasons behind my learning J is to translate a published set of 66 computer- assisted musical composition functions from APL to J. I'm pleasantly surprised that my intense trying over the past several months to understand array programming and J in particular seems to be paying off. Though by no means being anywhere near very knowledgeable, I've been able to look at both J and APL code and, in most cases, to understand what was going on and, with APL code, to successfully begin translating to J versions. (I've even been able to note on occasion that J had a better/shorter way to do something than the APL code did.)

However, I ran into an APL construction that I cannot find in the half dozen APL books I have. Since many/most of you have APL background, I thought I ask here so that I could have some assistance in translating to J. Here's the line that's stumped me (I substituted J's ~: for the APL not-equal symbol and <- for APL's assignment symbol):

   Z <- R,[_0.5](0 ~: ATTK)/ATTK <- +/[0] Z

I understand everything except the [_0.5] code and what it means in context. It doesn't seem to fit anything in my books about bracketed indexing in APL, and none of the book indexes lead to any information about what this construction might mean, so that I can translate it to J. Thanks in advance for any help!

----------------------------------------------------------------------
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

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

Reply via email to