|
From: | Juergen Sauermann |
Subject: | Re: [Bug-apl] Feature suggestion: multiple function arguments |
Date: | Tue, 15 Mar 2016 16:56:37 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
Hi, maybe, maybe not. it seems like in APL2, / and friends (⌿ \ and ⍀) are always operators. In GNU APL / and friends are operators if their left argument is a function, and functions if their left argument is a value. That's why 1 2 /¨ 3 4 is evaluated directly and without a derived function in GNU APL. The ISO standard lists Z←A/B and Z←A\B as mixed functions replicate (section 10.2.5) and expand (section 10.2.6), and clearly not as operator (section 9). I would also argue that there are good reasons for GNU APL to behave as it does (despite of its APL2 incompatibility). Consider this: 1 2 /¨ 3 4 3 4 4 Compress←{ ⍺ / ⍵ } 1 2 Compress ¨ 3 4 3 4 4 No surprize, right? But if we would always treat / as an operator, then the above would give two different results and that would, in my opinion, be rather counter-intuitive. And the syntax error is a mere consequence of / being a function in the example (you cannot bind a function to its left argument with (). /// Jürgen On 03/15/2016 03:54 PM, Elias Mårtenson
wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |