unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Quoted lambda expressions
@ 2013-08-17  8:32 Xue Fuqiao
  2013-08-17  9:24 ` Pascal J. Bourguignon
  0 siblings, 1 reply; 3+ messages in thread
From: Xue Fuqiao @ 2013-08-17  8:32 UTC (permalink / raw)
  To: emacs-devel

Hi,

AFAIK "(function (lambda ...))" and "#'(lambda ...)" are the same as
"(lambda ...)", because in subr.el:

   (defmacro lambda (&rest cdr)
     [...]
     (list 'function (cons 'lambda cdr)))

But the first two forms are used 600+ times in lisp/ and 13 times in
doc/.  Does it make sense to do some cleanup?

(And some of them should not be changed, such as the one in "(elisp)
Anonymous Functions".)

-- 
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Quoted lambda expressions
  2013-08-17  8:32 Quoted lambda expressions Xue Fuqiao
@ 2013-08-17  9:24 ` Pascal J. Bourguignon
  2013-08-17  9:36   ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Pascal J. Bourguignon @ 2013-08-17  9:24 UTC (permalink / raw)
  To: emacs-devel

Xue Fuqiao <xfq.free@gmail.com> writes:

> AFAIK "(function (lambda ...))" and "#'(lambda ...)" are the same as
> "(lambda ...)", because in subr.el:
>
>    (defmacro lambda (&rest cdr)
>      [...]
>      (list 'function (cons 'lambda cdr)))
>
> But the first two forms are used 600+ times in lisp/ and 13 times in
> doc/.  Does it make sense to do some cleanup?
>
> (And some of them should not be changed, such as the one in "(elisp)
> Anonymous Functions".)

That lambda macro was a late addition in the standardization of Common
Lisp.  I assume it was similarly late in emacs lisp.  That's the reason
why some lisp programmers use #'(lambda …) instead of (lambda …).

-- 
__Pascal Bourguignon__
http://www.informatimago.com/




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Quoted lambda expressions
  2013-08-17  9:24 ` Pascal J. Bourguignon
@ 2013-08-17  9:36   ` Andreas Schwab
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2013-08-17  9:36 UTC (permalink / raw)
  To: Pascal J. Bourguignon; +Cc: emacs-devel

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> I assume it was similarly late in emacs lisp.

It was added in 1992.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-17  9:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-17  8:32 Quoted lambda expressions Xue Fuqiao
2013-08-17  9:24 ` Pascal J. Bourguignon
2013-08-17  9:36   ` Andreas Schwab

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).