Discussion:
[Bug-apl] trouble with reduce by two with user-defined function
Daniel Lyons
2017-10-17 03:15:17 UTC
Permalink
I asked about this on Stack Overflow and was told it might be a bug in GNU APL. I'm a beginner so I don't know enough to say.

Basically, this works:

2+/1 2 3 4 5
┌→──────┐
│3 5 7 9│
└───────┘
This works too:

2{⍺+⍵}/1 2 3 4 5
┌→──────┐
│3 5 7 9│
└───────┘
This seems like it should to my amateur eyes, but it does not:

∇R←X FOO Y
R←X+Y
∇

2FOO/1 2 3 4 5
SYNTAX ERROR
ÎŒ-Z__pA_LO_REDUCE_X4_B[3] ÎŒ-T←⊂(⊃Ό-B3[ÎŒ-H;ÎŒ-a-ÎŒ-M;ÎŒ-L])ÎŒ-LO⊃Ό-T
^ ^
Whether it's a bug or not, I would like to know more about how to interpret the stuff APL gives back after the syntax error. I did not see an obvious relationship between my code and that message.

Stack Overflow link: https://stackoverflow.com/questions/46780195/reduce-by-two-with-named-function

Thanks for your time,
--
Daniel Lyons
Loading...