bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] n wise reduction after 740


From: Juergen Sauermann
Subject: Re: [Bug-apl] n wise reduction after 740
Date: Tue, 14 Jun 2016 14:44:22 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi Xtian,

the pollution of the )SI stack is sort of unavoidable with macros.

One could hide the macro calls, but that would give the wrong
idea of the real state of the )SI stack. Normally the macro arguments are
completely checked before the macro is called, so the )SI entries of macros
do not normally be investigated (except when the macro itself is faulty which
may happen initially when new macros are being introduced, but not later on).

The macro code becomes more readable when you remove all 
μ- prefixes, so

μ-Z__pA_LO_REDUCE_X_B[5]  μ-T←⊂(⊃μ-B1[μ-H;μ-a-μ-M;μ-L])μ-LO⊃μ-T

actually means:

Z__pA_LO_REDUCE_X_B[5]  T←⊂(⊃B1[H;a-M;L])LO⊃T

All macro definitions can be found in source file Macro.def (and the macro definitions
themselves are, of course, macros :-) ).

/// Jürgen


On 06/14/2016 04:47 AM, Christian Robert wrote:
How was that outputting *before* svn 740 ?

On 2016-06-13 22:11, Xiao-Yong Jin wrote:
Hello,

It breaks when the left argument is 1.  In addition, with the internal macros, the si stack is polluted.

      1+/⍳5
1 2 3 4 5

NARS2000 give the exact same result:

      1+/⍳5
1 2 3 4 5

quite strange, not sure what this should output, so, in gnuapl:

      1+/⍳5
1 2 3 4 5
      2+/⍳5
3 5 7 9
      10+/⍳5
DOMAIN ERROR
      10+/⍳5
      ^   ^
      3+/⍳5
6 9 12
      4+/⍳5
10 14
      5+/⍳5
15
      6+/⍳5

      7+/⍳5
DOMAIN ERROR
      7+/⍳5
      ^  ^

I really don't know what this syntax is supposed to do, but it has a fair/straight pattern.


      1{⍺+⍵}/⍳5
INDEX ERROR
μ-Z__pA_LO_REDUCE_X_B[5]  μ-T←⊂(⊃μ-B1[μ-H;μ-a-μ-M;μ-L])μ-LO⊃μ-T
                                 ^                         ^

NARS200 give here:

      1{⍺+⍵}/⍳5
DOMAIN ERROR
      1{⍺+⍵}/⍳5
            ∧

my 2 cents, (still newbie and will be for years)

Xtian.
      )sis
μ-Z__pA_LO_REDUCE_X_B[5]  μ-T←⊂(⊃μ-B1[μ-H;μ-a-μ-M;μ-L])μ-LO⊃μ-T
                                 ^                         ^
⋆  1{⍺+⍵}/⍳5
   ^

      )sinl
μ-Z__pA_LO_REDUCE_X_B[5]  μ-Z μ-A μ-LO μ-B μ-B1 μ-rho_Z μ-rho_B1 μ-T μ-H μ-M μ-L μ-a μ-N μ-I μ-I_max


Best,
Xiao-Yong







reply via email to

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