bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] A couple of bugs, and a question on the power operator


From: Kacper Gutowski
Subject: Re: [Bug-apl] A couple of bugs, and a question on the power operator
Date: Sat, 13 Aug 2016 22:34:24 +0200

On 13 August 2016 at 19:28, Juergen Sauermann wrote:
> It would also prevent the monadic use of the power operator with lambdas
> completely
> (which is not as bad as it sounds, though) because the lambdas are always
> ambivalent then.

I think treating all lambda functions as ambivalent is actually what
Dyalog does.  I present you the following transcript from Dyalog APL
version 14.0.23392.0 32 Unicode:

      1{⍵}2  ⍝ no error
2
      {1+⍵⊣⎕←'F'⍵}⍣{1=⍵⊣⎕←'G'⍵}1
F 1
G 1
2
      {1+⍵⊣⎕←'F'⍵}⍣{1=⍵⊣⎕←⍺'G'⍵}1
F 1
2 G 1
2
      ⍝ dyadic
      ∇R←A GD B
[1]  A'GD'B
[2]  R←1=B∇
      {1+⍵⊣⎕←'F'⍵}⍣GD 1
F 1
2  GD  1
2
      ⍝ ambivalent
      ∇R←{A} GA B
[1]  A'GA'B
[2]  R←1=B∇
      {1+⍵⊣⎕←'F'⍵}⍣GA 1
F 1
2  GA  1
2
      ⍝ monadic
      ∇R←GM B
[1]  'GM'B
[2]  R←1=B∇
      {1+⍵⊣⎕←'F'⍵}⍣GM 1
F 1
SYNTAX ERROR: The function does not take a left argument
      {1+⍵⊣⎕←'F'⍵}⍣GM 1
     ∧


I don't know if it changed in 15, but in 14 it clearly required right
function to be callable dyadically.


-k



reply via email to

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