bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] Identify function


From: Elias Mårtenson
Subject: Re: [Bug-apl] Identify function
Date: Tue, 1 Jul 2014 23:14:52 +0800

Well, + used to be the identify function before the introduction of complex numbers. Now + is the conjugate function (conjugate is equal to identity for reals).

I believe the identity function is useful when you have an operator where you want the passed-in function to do nothing. A somewhat contrived example would be an operator (let's call it ApplyPrint) that prints each element after applying it to the operator. You'd call it like so:

      {1+⍵}ApplyPrint 10 20 30
11
21
31

If you don't want to apply the function, just call the identify function:

      ⊢ApplyPrint 10 20 30 'foo'
10
20
30
foo

Silly example perhaps, but illustrates its usefulness.

Regards,
Elias


On 1 July 2014 23:04, Juergen Sauermann <address@hidden> wrote:
Hi Elias,

I looked in "Mastering APL" from Dyalog and could not find it.
They call + the identity function.

And what would be the use of it?

/// Jürgen



On 06/30/2014 06:24 AM, Elias Mårtenson wrote:
I was looking at the Dyalog reference manual and realised that they support monadic ⊢ (right) as the identity function. Adding support for this in GNU APL is trivial.

The attached patch implements this.

Regards,
Elias




reply via email to

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