I am playing around with GNU APL, but my experiments quickly reached an impasse. This is what happened:
x←1 2 3 4 5
⍝ build the matrix u where u_{ij} = x_i + x_j,
⍝ then filter the entries equal to 6
u←6=x∘.+x
So far so good, u
is a flipped identity matrix, as expected.
Now, I would like to get the indices of the nonzero entries, so I try
⍸u
but here I get a SYNTAX ERROR++
warning.
The same error appears when entering any of the following commands:
{⍸6=⍵∘.+⍵}x
{⍸6=⍵∘.+⍵} 1 2 3 4 5
{⍸6=⍵∘.+⍵} ⍳5
app←{⍸6=⍵∘.+⍵}
I suspect this is somehow a problem on my local installation, as I cannot reproduce the errors on the online interpreter.
Did somebody see this problem before? I compiled APL from source (ubuntu, GCC), the error appears in both versions 1.7 and 1.8. I could reproduce the error with the precompiled binary available from GNU's mirror. I wonder if I made a mistake in compiling and installing GNU APL, but the only non-standard thing I did was to unset the flag WERROR from the Makefile in the src folder, otherwise it would not compile due to an unchecked return value in the source.
I emailed bug-apl@gnu.org to get someone to have a look. This is the response I got:
no idea. I am getting this:
⍝ build the matrix u where u_{ij} = x_i + x_j, ⍝ then filter the entries equal to 6 u←6=x∘.+x ⍸u 1 5 2 4 3 3 4 2 5 1
SVN is 18005 aka. 1474 and the related code has not changed für years.
Regarding:
"otherwise it would not compile due to an unchecked return value in the source."
please report this kind of problems to bug-apl@gnu.org with a printout of the compiler's error message. Compilers are becoming increasingly picky about various this which causes code to happily compile for a decade an then out of a sudden raise a warning with a new compiler code.
I have the ambition that GNU APL compiles on almost all platforms and compilers and since I cannot test all platforms on my own it is important that users like you with a different platform inform me about problems.
Best Regards,
[Dr.] Jürgen [Sauermann, the main developer of GNU APL]
Support for ⍸
was added in December 2020 (r1368). Released tarballs don't have it; you will have to compile the development version from the repository to get it.
Note that tarballs are not the preferred way of installing GNU APL.