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
