[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-apl] Dyadic / (replicate) does not work with ¨ (each)
From: |
Jay Foad |
Subject: |
Re: [Bug-apl] Dyadic / (replicate) does not work with ¨ (each) |
Date: |
Mon, 24 Feb 2014 14:44:57 +0000 |
In IBM APL2, / ⌿ \ ⍀ are always operators:
3/4 ⍝ 3 is the left operand; derived function 3/ is applied
monadically to the argument 4
4 4 4
1 1 0/¨'GNU' 'APL' ⍝ derived function 1 1 0/ applied to each of
'GNU' and 'APL'
GN AP
... so you can't use /¨ in the way that you expected; in practice
it'll act like an each-right, using the whole of the left operand to
compress each of the items of the right argument.
Jay.
On 13 February 2014 05:23, Elias Mårtenson <address@hidden> wrote:
> The following gives a syntax error:
>
> ((1 1) (1 0))/¨'ab' 'cd'
> SYNTAX ERROR
> (1 1) (1 0)/¨'ab' 'cd'
> ^ ^
>
>
> But, assuming the following function:
>
> ∇Z←X sel Y
> Z←X/Y
> ∇
>
>
> This works:
>
> ((1 1) (1 0))sel¨'ab' 'cd'
> ab c
>
>
> Regards,
> Elias
>