all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#4290: 23.1; (elisp)Anonymous Functions - unclear about #'
@ 2009-08-29 21:07 Drew Adams
  0 siblings, 0 replies; 7+ messages in thread
From: Drew Adams @ 2009-08-29 21:07 UTC (permalink / raw)
  To: bug-gnu-emacs

This Info node is unclear. It combines pre-Emacs 22 text that
explicitly says that lambda forms are *not* byte-compiled unless you
use `#'' or `function', with this statement that says that they are:
 
  Nowadays it is possible to omit `function' entirely, like this:
     (defun double-property (symbol prop)
       (change-property symbol prop (lambda (x) (* 2 x))))
  This is because `lambda' itself implies `function'.
 
What should be said is something like this:
 
"Starting with Emacs 22, a lambda form is byte-compiled when it is used
as a function, regardless of whether it is preceded by `function' or
`#''.  With Emacs versions prior to 22, you must explicitly use `#''
or `function' if you want the form to be byte-compiled."
 
This means rewording or replacing the paragraph that says that unless
you use `function' a lambda form won't be byte-compiled. The example
and its accompanying text need to be clarified.
 

In GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
 of 2009-07-29 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4)'
 







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

* Re: 23.1; (elisp)Anonymous Functions - unclear about #'
@ 2009-09-12  2:02 Chong Yidong
  2009-09-12  6:13 ` bug#4290: " Drew Adams
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Chong Yidong @ 2009-09-12  2:02 UTC (permalink / raw)
  To: Drew Adams; +Cc: 4290, emacs-devel

> This Info node is unclear. It combines pre-Emacs 22 text that
> explicitly says that lambda forms are *not* byte-compiled unless you
> use `#'' or `function', with this statement that says that they are:

>   Nowadays it is possible to omit `function' entirely, like this:
>      (defun double-property (symbol prop)
>        (change-property symbol prop (lambda (x) (* 2 x))))
>   This is because `lambda' itself implies `function'.

Thanks for spotting this.

Hmm---is `function' still useful for anything?




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

* bug#4290: 23.1; (elisp)Anonymous Functions - unclear about #'
@ 2009-09-12  2:02 Chong Yidong
  0 siblings, 0 replies; 7+ messages in thread
From: Chong Yidong @ 2009-09-12  2:02 UTC (permalink / raw)
  To: Drew Adams; +Cc: 4290, emacs-devel

> This Info node is unclear. It combines pre-Emacs 22 text that
> explicitly says that lambda forms are *not* byte-compiled unless you
> use `#'' or `function', with this statement that says that they are:

>   Nowadays it is possible to omit `function' entirely, like this:
>      (defun double-property (symbol prop)
>        (change-property symbol prop (lambda (x) (* 2 x))))
>   This is because `lambda' itself implies `function'.

Thanks for spotting this.

Hmm---is `function' still useful for anything?





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

* bug#4290: 23.1; (elisp)Anonymous Functions - unclear about #'
  2009-09-12  2:02 23.1; (elisp)Anonymous Functions - unclear about #' Chong Yidong
@ 2009-09-12  6:13 ` Drew Adams
  2009-09-12  6:13 ` Drew Adams
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Drew Adams @ 2009-09-12  6:13 UTC (permalink / raw)
  To: 'Chong Yidong'; +Cc: 4290, emacs-devel

> > This Info node is unclear. It combines pre-Emacs 22 text that
> > explicitly says that lambda forms are *not* byte-compiled unless you
> > use `#'' or `function', with this statement that says that they are:
> 
> >   Nowadays it is possible to omit `function' entirely, like this:
> >      (defun double-property (symbol prop)
> >        (change-property symbol prop (lambda (x) (* 2 x))))
> >   This is because `lambda' itself implies `function'.
> 
> Thanks for spotting this.
> 
> Hmm---is `function' still useful for anything?

At the very least it is needed for comptability with older Emacs versions. It
needs to be tolerated, at least.






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

* RE: 23.1; (elisp)Anonymous Functions - unclear about #'
  2009-09-12  2:02 23.1; (elisp)Anonymous Functions - unclear about #' Chong Yidong
  2009-09-12  6:13 ` bug#4290: " Drew Adams
@ 2009-09-12  6:13 ` Drew Adams
  2009-09-12 19:41 ` Stefan Monnier
  2009-09-12 19:41 ` bug#4290: " Stefan Monnier
  3 siblings, 0 replies; 7+ messages in thread
From: Drew Adams @ 2009-09-12  6:13 UTC (permalink / raw)
  To: 'Chong Yidong'; +Cc: 4290, emacs-devel

> > This Info node is unclear. It combines pre-Emacs 22 text that
> > explicitly says that lambda forms are *not* byte-compiled unless you
> > use `#'' or `function', with this statement that says that they are:
> 
> >   Nowadays it is possible to omit `function' entirely, like this:
> >      (defun double-property (symbol prop)
> >        (change-property symbol prop (lambda (x) (* 2 x))))
> >   This is because `lambda' itself implies `function'.
> 
> Thanks for spotting this.
> 
> Hmm---is `function' still useful for anything?

At the very least it is needed for comptability with older Emacs versions. It
needs to be tolerated, at least.





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

* bug#4290: 23.1; (elisp)Anonymous Functions - unclear about #'
  2009-09-12  2:02 23.1; (elisp)Anonymous Functions - unclear about #' Chong Yidong
                   ` (2 preceding siblings ...)
  2009-09-12 19:41 ` Stefan Monnier
@ 2009-09-12 19:41 ` Stefan Monnier
  3 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2009-09-12 19:41 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 4290, emacs-devel

> Thanks for spotting this.
> Hmm---is `function' still useful for anything?

Well, it's just as useful as ever.  I.e. it's useless when you consider
that its implementation is the same as `quote', but it's otherwise
indispensable (e.g. look at the implementation of the `lambda' macro in
subr.el).


        Stefan





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

* Re: 23.1; (elisp)Anonymous Functions - unclear about #'
  2009-09-12  2:02 23.1; (elisp)Anonymous Functions - unclear about #' Chong Yidong
  2009-09-12  6:13 ` bug#4290: " Drew Adams
  2009-09-12  6:13 ` Drew Adams
@ 2009-09-12 19:41 ` Stefan Monnier
  2009-09-12 19:41 ` bug#4290: " Stefan Monnier
  3 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2009-09-12 19:41 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 4290, Drew Adams, emacs-devel

> Thanks for spotting this.
> Hmm---is `function' still useful for anything?

Well, it's just as useful as ever.  I.e. it's useless when you consider
that its implementation is the same as `quote', but it's otherwise
indispensable (e.g. look at the implementation of the `lambda' macro in
subr.el).


        Stefan




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

end of thread, other threads:[~2009-09-12 19:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-12  2:02 23.1; (elisp)Anonymous Functions - unclear about #' Chong Yidong
2009-09-12  6:13 ` bug#4290: " Drew Adams
2009-09-12  6:13 ` Drew Adams
2009-09-12 19:41 ` Stefan Monnier
2009-09-12 19:41 ` bug#4290: " Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2009-09-12  2:02 Chong Yidong
2009-08-29 21:07 Drew Adams

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.