[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-apl] Power Operator (⍣) broken at svn 740 ?
From: |
Xiao-Yong Jin |
Subject: |
Re: [Bug-apl] Power Operator (⍣) broken at svn 740 ? |
Date: |
Sun, 12 Jun 2016 22:32:43 -0500 |
Hi Jüergen and Christian,
> On Jun 12, 2016, at 4:28 AM, Juergen Sauermann <address@hidden> wrote:
>
> the reason is that the arguments of the right function argument of ⍣
> have different lengths and are therefore always unequal:
>
> FIB←{ 3↓ {⍵,+/¯2↑⍵}⍣{(↑⍵)≤¯3+⍴⍺ ⊣ ⎕←'debug:' (⍴⍵) 'vs' (⍴¯3+⍴⍺)} ⊢ ⍵, 0
> 1 }
> FIB 12
> debug: 3 vs 1
> debug: 4 vs 1
> debug: 5 vs 1
> debug: 6 vs 1
> debug: 7 vs 1
> debug: 8 vs 1
> debug: 9 vs 1
> debug: 10 vs 1
> debug: 11 vs 1
> debug: 12 vs 1
> debug: 13 vs 1
> debug: 14 vs 1
> debug: 15 vs 1
> debug: 16 vs 1
> debug: 17 vs 1
> ...
>
> The power operator is now a macro which uses ≡ instead of ↑=
> (which was sort of working, but wrong). The Dyalog manual says:
>
> "The right argument must be a dyadic function that returns a Boolean scalar",
Despite what is in their manual, dyalog seems to treat 1 scalar element vector
as a scalar here,
⎕ML←2
FIB←{ 3↓ {⍵,+/¯2↑⍵}⍣{(↑⍵)≤¯3+⍴⍺ ⊣ ⎕←'debug:' (⍴⍵) 'vs' (⍴¯3+⍴⍺)} ⊢ ⍵, 0 1
}
FIB 12
debug: 3 vs 1
debug: 4 vs 1
debug: 5 vs 1
debug: 6 vs 1
debug: 7 vs 1
debug: 8 vs 1
debug: 9 vs 1
debug: 10 vs 1
debug: 11 vs 1
debug: 12 vs 1
debug: 13 vs 1
debug: 14 vs 1
1 2 3 5 8 13 21 34 55 89 144 233