bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] A few problems


From: Dr . Jürgen Sauermann
Subject: Re: [Bug-apl] A few problems
Date: Wed, 6 Feb 2019 15:10:43 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 02/05/2019 11:37 PM, vvs wrote:
On Tue, Feb 5, 2019 at 7:08 PM Dr. Jürgen Sauermann
<address@hidden> wrote:
It also raises the following question:

∇Z←A
 Z←42
∇

A←5

A

What is A and why so? And its is definitely not ISO which says (page 67):
...
If V is a variable-name,
If the current-class of V is nil or variable,
Set the current-referent of V to a token whose class is variable and whose
content is the content of B.
Return a token whose class is committed-value and whose content is B.
Otherwise, signal syntax-error.
I don't follow. For me A is clearly a variable-name, so its content is
5, i.e. B. This is what NARS2000 returns. Why it isn't ISO? BTW, ISO
Certainly not:

∇Z←A
 Z←42


At this point A has token class Niladic-Defined-Function-Name (page 25), An attempt to
change that by:

A←5

is therefore explicitly forbidden by the statement on page 67. It has always bin that way since
the invention of APL. You need to )ERASE A (or → if A was localized) before you can change it
from beiing a function to becoming a variable. And that is rather independent of whether
assigning a function to a name is supported or not. This is different from the case where
A is a function already: in that case one might allow assignment of a different function
with the same signature even though that can also create pathological cases.
doesn't even contains assignment to defined-function-name-token, but
only to variable-name-token. Do you mean that the class of a token has
changed and there should be a syntax-error? Yes, NARS2000 isn't
conforming by not signalling a syntax-error, but I believe that it's
just a bug and could be fixed. GNU APL in a very similar situation now
just hangs, i.e.:

∇Z←A
A←0
Z←A
∇
A←1

"Informal Description: Bind-token-class is used to bind each
identifier in current-
statement to its current syntactic-unit; if the class of a token
changes between this
point and the time the token is used (as it would for example in F
⎕EX'F' , assuming
F were initially a defined-function), the change will be detected and
reported as a
syntax-error in the appropriate phrase-evaluator."

Also, I think that this behavior is following from the NARS2000
extension which allows for modified assignment, e.g. A+←1 which means
A←A+1 (cf. C/C++ A += 1) and which would be ambiguous otherwise.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]