[Top][All Lists]

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

Re: [Bug-apl] Rank operator and function assignment

From: Tobia Conforto
Subject: Re: [Bug-apl] Rank operator and function assignment
Date: Thu, 6 Mar 2014 01:27:30 +0100

Hi Juergen

> how does NARS2000 define f⍤B and A f⍤B (the standard does not)?

I can answer this.
f⍤y is just the function that would be applied to B in f⍤y B, so that one can 
give it a name: g←f⍤y and then apply it: g B

A f⍤B is a syntax error, because f⍤B becomes a function, which then lacks the 
right argument.

> In GNU APL you can put the y in axis brackets to resolve the ambiguity.
> I personally believe ⍤[y] B is a clearer syntax than ⍤y B.
>       {'foo',⍵}⍤[1] 4 5⍴⍳10

This ambiguity between the right argument of the operator and that of the 
derived function (⍵⍵ and ⍵) or more rarely between the two left arguments (⍺ 
and ⍺⍺) is usually resolved using either parentheses around the derived 
function or using the right identity function ⊢ This is true even for other 
common operators:

        ⊂⍣3⊢⍳3   ⍝ enclose ⍳3 three times
        (⊂⍣3)⍳3   ⍝ same

Parentheses around the right argument mean something else in dialects with 
"strands" such as Dyalog:

        ⊂⍣3(⍳3)   ⍝ this produces the derived function ⊂⍣(3,⊂⍳3) which will 
give an error when applied

I would be wary of bracket notation on the rank operator, because it has a 
different meaning in Nars2000 (which I'm not sure I understand entirely) see 
That page mentions conforming to ISO 13751, so I would check whether the 
bracket notation should have a particular meaning according to it (maybe where 
they define bracket notation in general?)


reply via email to

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