bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Error declaring nihilic operator with index


From: Juergen Sauermann
Subject: Re: [Bug-apl] Error declaring nihilic operator with index
Date: Sat, 26 Jul 2014 18:36:25 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5

Hi Elias,

you cannot define a niladic function with axis because you could not call it.
There is no reduction pattern defined for that - not in ISO and not in IBM APL2.
N[X] computes N and then indexes it with X and does not call N with axis X.

The other problem was a missing check for valid function headers - { ⍶ χ }
would be a niladic operator (which also does not exist). SVN 396 now issues
a syntax error when you try to define it.

/// Jürgen


On 07/25/2014 07:47 AM, Elias Mårtenson wrote:
I'm getting an error declaring a nihilic operator that has an index parameter using ⎕FX:

      ⎕FX 'Z←(OP F)[V]' "OP V"
1

When I declare it using the lambda format, the declaration works but trying to call it gives an error. Trying to call it without the index parameter (but with a normal parameter) causes a crash:

      FF ← { ⍶ χ }
      -FF[10]
SYNTAX ERROR
     -FF 10


====================================================
SEGMENTATION FAULT

----------------------------------------
-- Stack trace at main.cc:140
----------------------------------------
0xa @@@@
0xa  @@@@
0xa   @@@@
0xa    @@@@
0xa     @@@@
0xa      @@@@
0xa       @@@@
0xa        @@@@
0xa         @@@@
0xa          @@@@
0x0           @@@@
0x0            @@@@
0xa             @@@@
========================================
====================================================

Regards,
Elias


reply via email to

[Prev in Thread] Current Thread [Next in Thread]