The syntax error is new in the latest beta. First, local copula is the
same as global copula when not inside an explicit definition. So the
first part by p j works because the assignment of a1 is really a global
assignment even though a local copula is used.
In the second set where the statements are included within an explicit
definition the local copula is really a local assignment, not global.
An assignment of a name as both global and local within a definition now
results an error.
By the way, when a script is run using the load verb all statements are
within an explicit definition.
I thought that the error only occurred when a global assignment was made
to a local name but it appears that it checks both ways.
Miller, Raul D wrote:
p j wrote:
These 2 lines need to be defined in a module. Wont
work at top level.
a1=: 6
temp61=: >:@(a1&*)@([&a1=. 12)
You're right, this is a bug. Compare:
3 :0''
a1=: 6
temp61=: >:@(a1&*)@([&a1=. 12)
)
|syntax error
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm