[Top][All Lists]

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

RE: How to quote a list of functions?

From: Drew Adams
Subject: RE: How to quote a list of functions?
Date: Tue, 18 Aug 2015 18:37:26 -0700 (PDT)

> >> when and why are functions refered to not using
> >> symbols to designate them?
> >
> > Anonymous functions.
> Those have been mentioned many times by now.
> What about them? If you mean lambdas I have used them
> for many years with no use of any sharp notation.

I was answering your question (above), which is not about
sharp-sign notation.  Functions are referred to without
using symbols to designate them when they are anonymous.

And no, there is no need to use either `quote' or `function'
with lambda forms in Emacs Lisp.  Don't do that.

If you quote (') a lambda then Emacs handles it as a list,
which means that it cannot (at that time) take advantage of
knowing that it is a function.  If you do that, it is hard
for Emacs to guess that you want to mention a function and
you do not want to construct data that is a list with first
element `lambda' (for whatever reason or subsequent processing).

If you use `function' (#') on a lambda form and you are
mistaken in any way, then Emacs will assume that it is a
function when it might not be.  Let Emacs decide what it
is - it will generally DTRT/DWYM with a bare lambda.

> It is clear that functions and symbols are different
> things but it is not clear what you would gain by
> sometimes referring to functions as functions and
> sometimes by the symbols denoting them,

Some operations you might want use on symbols do not
apply to functions, and vice versa.  You can use function
symbols with both such kinds of operations.  Just as you
can use (lambda ...) with both function operations and
list operations (depending on the context).

But I (and others) already wrote this.  You have only to read it.

> and it is especially confusing as the "function as function" way
> of referring to them requires a special syntax compared
> to referring to everything else in Lisp! 

Dunno what you mean by either part of that statement; sorry.
But you need not elaborate for my benefit. ;-)

> And this is also tedious as every time a function is refered to
> you have to verify with the function called what it
> expects - a function, or a symbol denoting a function?

You don't have to do anything.  Emacs Lisp is what it is.
No one is forced to use it.  And you can use it any way you
like.  If what people are telling you does not help, move
along (ignore).

reply via email to

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