[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-apl] Outer product with replicate error
From: |
Hans-Peter Sorge |
Subject: |
Re: [Bug-apl] Outer product with replicate error |
Date: |
Mon, 16 May 2016 16:25:52 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 |
Am 15.05.2016 um 03:49 schrieb David B. Lamkins:
> While `$ info apl` speaks to the issues around function/operator ambiguity,
> it does not make any mention of the outer product case.
>
> I suspect that the failure of "outer product expand" is an oversight. This
> case is disambiguated by noticing the outer product during the right-to-left
> scan that GNU APL does anyway (step 3 in the referenced info page).
>
> Outer product is a common idiom dating from the earliest days of APL. It
> doesn't make any sense to require special (i.e. specific to GNU APL) syntax
> for this particular case.
>
>
> On Sat, May 14, 2016 at 01:31:13PM -0500, Xiao-Yong Jin wrote:
>>
>>> On May 14, 2016, at 7:51 AM, David Tran <address@hidden> wrote:
>>>
>>> Hi,
>>>
>>> Newbie study "MasteringDyalogAPL"; got error on page #388 example:
>>>
>>> 3 0 2 ∘./ 5 1 7
>>> SYNTAX ERROR
>>> 3 0 2∘./5 1 7
>>> ^ ^
>>>
>>> bug? ( or this is a specify feature of Dyalog and not APL2 ? )
>>
>> It’s documented in the info page of gnu apl. A feature (bug?) of the parser
>> treats / as an operator in this case. Simple workaround would be
>>
>> 3 0 2 ∘.{⍺/⍵} 5 1 7
>> 5 5 5 1 1 1 7 7 7
>>
>> 5 5 1 1 7 7
>>
>> I have too limited experience to say whether it is good or bad. Perhaps the
>> parser should accept some exceptional cases?
>>
>> Best,
>> Xiao-Yong
>>
>>
>>
>
Hi,
just to mention, there is an other difference in interpretation
regarding the scan operator GNU-APL vs IBM-APL.
GNU-APL:
1 2 3 /¨ 4 5 6
4 5 5 6 6 6
IBM-APL:
1 2 3 /¨ 4 5 6
4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6
Best Regards,
Hans-Peter