Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

anonymous functions



>>>>> On February 11, 2011 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> If your zsh is recent enough to have anonymous functions

Why are these things called 'anonymous functions'?  That name connotes
lambda, which would create an unnamed function you could store in a
variable, pass as an argument, return from a function, and call at
some later time.  They should be called 'local scopes' or 'local
blocks' or even 'blocks', and use their own reserved word.

The concepts are of course related; in lisp-like languages

(let ((a <e1>) (b <e2>) (c <e3>)) <body>)

is of course equivalent to

((lambda (a b c) <body>) <e1> <e2> <e3>)

Greg



Messages sorted by: Reverse Date, Date, Thread, Author