bug-apl
[Top][All Lists]
Advanced

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

[Bug-apl] PT←⎕NEW Point -- An example lifted from microapl returns val


From: Akiva Avraham
Subject: [Bug-apl] PT←⎕NEW Point -- An example lifted from microapl returns value errors.
Date: Wed, 28 May 2014 20:15:19 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

I am not experienced enough in gnu-APL to determine whether you intend for this type of _expression_ to be executable, so I just bring it to your attention.

http://www.microapl.co.uk/apl_help/ch_020_020_310.htm

If the arguments contain object (or class) references, the elements are considered equal if the reference indices are the same, i.e. if they refer to the same entry in APL's internal table of objects. For internal objects, this will be true if and only if the elements refer to the same object. Note that different objects which happen to contain the same properties are not considered equal. For example, if Point is a simple class with properties X and Y:

             PT←⎕NEW Point
             PT.X←63 ⋄ PT.Y←42
             A←PT
             B←PT.⎕CLONE 1
             A.⎕DS
       X=63, Y=42
             B.⎕DS
       X=63, Y=42
             A=PT      ⍝ References to the same object
       1       
             B=PT      ⍝ Objects are different, but have the same property values
       0

For external objects, there might be two references which APL does not know refer to the same object. Therefore the use of the APL Equals primitive on external objects is not recommended.


--

reply via email to

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