In Dyalog APL, one can use modified assignment, e.g.
+← with ordinary variables, including indexed arrays. The question is:
Should this work in a comparable way with class instances (class-based objects)?. Specifically, should it work as expected with methods defined via keywords
:Property Default Keyed MyMethod in examples like
Code: Select all
a[1 2 3]+←10 100 1000 ⍝ where ¨a¨ is an object defined via ⎕NEW
where
1 2 3 are keys? Before I post a stripped-down test case (and with the caveat that it might always be my error), I wanted to check if it is
supposed to work. Two points:
1. APL allows it; it returns no error; it's happily wrong.
2. It seems to work properly on the first key in the vector
1 2 3, but not apply the modifying function
+ on subsequent elements.
3. I can't find documentation or examples that might guide me. (And yes, I can't count points properly).
Any experience out there?