bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] This looks wrong


From: Juergen Sauermann
Subject: Re: [Bug-apl] This looks wrong
Date: Thu, 07 Aug 2014 14:56:14 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5

Hi,

for me it is not at all clear why {1} 0 should eat (and discard) its right argument.

In other words why would {1} 0 behave differently than N 0 with N being a niladic function?

That would create new rules in the APL syntax without a need. I would rather opt for David's
"principle of least surprises" than for Dyalog compatibility in this case.

/// Jürgen


On 08/07/2014 10:43 AM, Elias Mårtenson wrote:
Jay,

That makes sense. So the only benefit of the GNU APL approach is that it allows the definition of niladic functions by assigning from a lambda.

My personal opinion is that that's barely a benefit, and that the Dyalog approach is much better.

Perhaps Jürgen is willing to reconsider?

Regards,
Elias


On 7 August 2014 16:35, Jay Foad <address@hidden> wrote:
Elias,

There is no such thing as a niladic lambda in Dyalog.

In Dyalog "niladic lambda functions [are] not [...] allowed at all.
Instead, they [are] interpreted as monadic functions that ignore their
argument."

So {1} is a monadic function. You can evaluate it by applying it to an argument:

      {1}0
1

(Actually in Dyalog lambdas are not monadic or dyadic. They are all
"ambivalent". If they do not refer to ⍺ then any left argument will be
ignored.)

Jay.

On 7 August 2014 09:09, Elias Mårtenson <address@hidden> wrote:
> Jay,
>
> I also noticed that Dyalog does not allow self-evaluation of niladic
> lambdas. I.e. the _expression_ {1} on its own does not evaluate to 1, but
> rather to something else (it's displayed as {1}, and I'm not sure you can do
> anything with it other than assigning it to a variable).
>
> Regards,
> Elias
>
>
> On 7 August 2014 16:00, Jay Foad <address@hidden> wrote:
>>
>> On 6 August 2014 14:15, Elias Mårtenson <address@hidden> wrote:
>> > My suggestion is that niladic lambda functions will not be allowed at
>> > all.
>> > Instead, they will be interpreted as monadic functions that ignore their
>> > argument.
>>
>> That's consistent with the behaviour of Dyalog.
>>
>> Jay.
>
>



reply via email to

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