Page 1 of 1

Are conjunctions unassignable?

Posted: Thu May 14, 2020 1:58 pm
by ArrayMac227
opp←{⍺ ⍺⍺ ⍵⍵ ⍵}
tfuu←opp
SYNTAX ERROR
tfuu←opp


⍝ How do I assign opp?

Re: Are conjunctions unassignable?

Posted: Thu May 14, 2020 3:55 pm
by Roger|Dyalog
In current Dyalog APL, a dyadic d-operator may be named using ←. No other dyadic operator may not so named. For example,

      rank←⍤
SYNTAX ERROR
rank←⍤

Re: Are conjunctions unassignable?

Posted: Fri May 15, 2020 10:16 am
by Phil Last
Roger|Dyalog wrote:... a dyadic d-operator may be named using ←. ...
but not reassigned as Randy discovered
Randy wrote:... tfuu←opp ...

Re: Are conjunctions unassignable?

Posted: Fri May 15, 2020 4:14 pm
by Phil Last
You can't create a reference to it
      )clear
clear ws
opp←{⍺←⊢ ⋄ (⍺ ⍺⍺ ⍵)⍵⍵ ⍵}
)ns s
#.s
s.op←opp
SYNTAX ERROR
s.op←opp
either thither ↑ or thence ↓
      )cs s
#.s
op←#.opp
SYNTAX ERROR
op←#.opp
^
but you can call it directly with its fully qualified name
      2 + #.opp × 3
15
or you can create a cover that does that for you
      op←{⍺←⊢ ⋄ ⍺ ⍺⍺ #.opp ⍵⍵ ⍵}
2 + op × 3
15