question: selective assignment (with a commute on the left)
Selective assignment (with replicate on the left) works as expected (in April and Dyalog):
d←'bob'
(1 0 0/d)←'B'
d
Bob
But the same thing (though expressed with a commute) does not in Dyalog:
d←'bob'
(d/⍨1 0 0)←'B'
SYNTAX ERROR
(d/⍨1 0 0)←'B'
∧
and in April:
The value
#:G2102
is not of type
LIST
[Condition of type TYPE-ERROR]
The limitation in Dyalog is discussed here but I was wondering if April needs to have this limitation?
It sounds like the Dyalog limitation is expressed in terms of tokens as B Wilson says "the name to be assigned must be the rightmost token in the overall left expression." But if the validation was done later in the interpretation process (perhaps once you have a parse tree) then it it could noticed that, when a commute occurs, the textual rightmost token might not be the same as the logical rightmost token.
Interesting idea, I could probably register that given how I compose the assign-by-select syntax. I'll give it a try.
@phantomics cool! I'll be interested to hear if the April approach can handle arbitrarily nested commutes. Seems like if you are using the parse tree then it would be possible.