I am using GNU APL 1.1 (svn 4460) on Linux 2.6.32 and I have some problems with function definitions.
This snippet works as expected:
∇R←ODD N
R←2|N
∇
(ODD L)/L←⍳10
But when I try this
{2|⍵} 5
or this
ODD←{2|⍵}
I get a syntax error. The same snippets run fine here.
I am a complete beginner to APL. Could anyone explain me what causes this syntax error?
You first example uses conventional APL "del" notation to define a function. The second two examples use direct definition (commonly known as dfns - pronounced dee-funs) which is an extension by Dyalog APL, and obviously does not run in the interpreter you are using. The ease of defining functions this way is a great advantage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With