unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 24.3.50; Use of deprecated ((lambda ...) ...) form
@ 2012-11-09 14:12 Sam Steingold
  2012-11-09 15:59 ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Sam Steingold @ 2012-11-09 14:12 UTC (permalink / raw)
  To: emacs-devel

byte compilation now warns

.emacs.el:46:39:Warning: Use of deprecated ((lambda ...) ...) form
.emacs.el:46:39:Warning: Use of deprecated ((lambda ...) ...) form
.emacs.el:46:39:Warning: Use of deprecated ((lambda ...) ...) form
.emacs.el:46:39:Warning: Use of deprecated ((lambda ...) ...) form
.emacs.el:1255:20:Warning: Use of deprecated ((lambda ...) ...) form
.emacs.el:1259:43:Warning: Use of deprecated ((lambda ...) ...) form

for forms like

(eval-and-compile (defvar ...))

and

(defvar (eval-and-compile ...))

why is ((lambda ...) ...) deprecated?
this is one of the oldest lisp constructs!

if it is to be deprecated, then the macros above must be modified so
that their compilation does not warn.

In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2)
 of 2012-11-09 on t520sds
Bzr revision: 110854 dmantipov@yandex.ru-20121109113831-qc320e2iyim99bq8
Windowing system distributor `The X.Org Foundation', version 11.0.11103000
System Description:	Ubuntu 12.04.1 LTS

Configured using:
 `configure '--with-wide-int''

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: C
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  rcirc-track-minor-mode: t
  which-function-mode: t
  url-handler-mode: t
  show-paren-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  abbrev-mode: t

Recent input:
C-x C-f . e m <tab> e <tab> <backspace> <tab> <return> 
C-c c <select-window> <select-window> <help-echo> <down-mouse-1> 
<mouse-2> <help-echo> <help-echo> <help-echo> <select-window> 
<help-echo> <select-window> <help-echo> <down-mouse-1> 
<mouse-2> <help-echo> <down-mouse-1> <mouse-2> <help-echo> 
M-x b b d b - r e p o <tab> <M-backspace> <M-backspace> 
e m - r - b <tab> <backspace> <backspace> <tab> <tab> 
<tab> <M-backspace> <M-backspace> r e p o <tab> <r
eturn>

Recent messages:

Warning: /home/sds/.emacs.el is newer than /home/sds/.emacs.elc
Loading vc-hg...done
Compiling /home/sds/.emacs.el...
Mark set
Compiling /home/sds/.emacs.el...done
Wrote /home/sds/.emacs.elc
Mark set
mouse-2: visit this file, line and column
Mark set [2 times]

Load-path shadows:
/home/sds/src/sitelisp/jdee/lisp/.dir-locals hides /home/sds/src/emacs/trunk/lisp/gnus/.dir-locals
/home/sds/src/emacs/trunk/lisp/textmodes/flyspell hides /usr/share/emacs/site-lisp/dictionaries-common/flyspell
/home/sds/src/emacs/trunk/lisp/textmodes/ispell hides /usr/share/emacs/site-lisp/dictionaries-common/ispell

Features:
(shadow sort bbdb-message mailalias cookie1 mail-extr gnus-msg gnus-art
mm-uu mml2015 epg-config mm-view mml-smime smime dig mailcap gnus-sum
nnoo gnus-group gnus-undo nnmail mail-source gnus-start gnus-spec
gnus-int gnus-range gnus-win emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums cl-macs gv vc-hg midnight
autoloads gnus gnus-ems nnheader mail-utils wid-edit bbdb-mua bbdb-com
mailabbrev bbdb-loaddefs bbdb timezone rcirc server uniquify warnings
which-func imenu url-handlers url-parse auth-source eieio byte-opt
bytecomp byte-compile cconv gnus-util mm-util mail-prsvr password-cache
url-vars paren help-at-pt cus-start cus-load ido ess-toolbar ess-mouse
mouseme thingatpt browse-url ess-menu ess-swv ess-noweb
ess-noweb-font-lock-mode ess-bugs-l essd-els ess-sas-d ess-sas-l
ess-sas-a shell pcomplete ess-arc-d ess-vst-d ess-xls-d ess-lsp-l
ess-sta-d ess-sta-l cc-vars cc-defs make-regexp ess-sp6-d ess-sp5-d
ess-sp3-d ess-julia ess-r-d compile ess-tracebug ess-roxy advice
advice-preload hideshow ess-help ess-developer ess-r-args eldoc help-fns
ess-s-l ess ess-inf comint ansi-color ring ess-mode ess-noweb-mode
ess-utils ess-custom executable easymenu ess-compat ess-site cl cl-lib
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)

-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://thereligionofpeace.com http://dhimmi.com
http://mideasttruth.com http://openvotingconsortium.org http://think-israel.org
If you know that you know nothing, you know too much.



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

* Re: 24.3.50; Use of deprecated ((lambda ...) ...) form
  2012-11-09 14:12 Sam Steingold
@ 2012-11-09 15:59 ` Stefan Monnier
  2012-11-09 16:15   ` Paul Eggert
                     ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Stefan Monnier @ 2012-11-09 15:59 UTC (permalink / raw)
  To: sds; +Cc: emacs-devel

[ Please use M-x report-emacs-bug (or send it to
  bug-gnu-emacs@gnu.org). ]

> byte compilation now warns
> .emacs.el:46:39:Warning: Use of deprecated ((lambda ...) ...) form
> .emacs.el:46:39:Warning: Use of deprecated ((lambda ...) ...) form
> .emacs.el:46:39:Warning: Use of deprecated ((lambda ...) ...) form
> .emacs.el:46:39:Warning: Use of deprecated ((lambda ...) ...) form
> .emacs.el:1255:20:Warning: Use of deprecated ((lambda ...) ...) form
> .emacs.el:1259:43:Warning: Use of deprecated ((lambda ...) ...) form
> for forms like
> (eval-and-compile (defvar ...))

Oh, sorry I forgot one hunk.  Should be fixed now.

> why is ((lambda ...) ...) deprecated?

Why not?

> this is one of the oldest lisp constructs!

Old doesn't make it good.  If you want to bind local variables, you know
where to find `let', don't you?

> If it is to be deprecated, then the macros above must be modified so
> that their compilation does not warn.

Actually, the problem was much deeper than in those macros.  But yes, it
needs to be fixed.


        Stefan



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

* Re: 24.3.50; Use of deprecated ((lambda ...) ...) form
  2012-11-09 15:59 ` Stefan Monnier
@ 2012-11-09 16:15   ` Paul Eggert
  2012-11-09 16:38   ` Sam Steingold
  2012-11-09 16:50   ` Drew Adams
  2 siblings, 0 replies; 12+ messages in thread
From: Paul Eggert @ 2012-11-09 16:15 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: sds, emacs-devel

On 11/09/2012 07:59 AM, Stefan Monnier wrote:
> Old doesn't make it good.  If you want to bind local variables,
> you know where to find `let', don't you?

I agree with Sam.  The equivalence of 'let' to 'lambda'
is a standard koan of Lisp.  We shouldn't discard it
so lightly.



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

* Re: 24.3.50; Use of deprecated ((lambda ...) ...) form
  2012-11-09 15:59 ` Stefan Monnier
  2012-11-09 16:15   ` Paul Eggert
@ 2012-11-09 16:38   ` Sam Steingold
  2012-11-09 17:05     ` Glenn Morris
  2012-11-09 16:50   ` Drew Adams
  2 siblings, 1 reply; 12+ messages in thread
From: Sam Steingold @ 2012-11-09 16:38 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> * Stefan Monnier <zbaavre@VEB.HZbagerny.PN> [2012-11-09 10:59:36 -0500]:
>
> [ Please use M-x report-emacs-bug (or send it to
>   bug-gnu-emacs@gnu.org). ]

I thought that list was only for released versions.

>> byte compilation now warns
>> .emacs.el:46:39:Warning: Use of deprecated ((lambda ...) ...) form
>> .emacs.el:46:39:Warning: Use of deprecated ((lambda ...) ...) form
>> .emacs.el:46:39:Warning: Use of deprecated ((lambda ...) ...) form
>> .emacs.el:46:39:Warning: Use of deprecated ((lambda ...) ...) form
>> .emacs.el:1255:20:Warning: Use of deprecated ((lambda ...) ...) form
>> .emacs.el:1259:43:Warning: Use of deprecated ((lambda ...) ...) form
>> for forms like
>> (eval-and-compile (defvar ...))
>
> Oh, sorry I forgot one hunk.  Should be fixed now.

thanks.

>> why is ((lambda ...) ...) deprecated?
> Why not?

because it is useful and beautiful.

>> this is one of the oldest lisp constructs!
>
> Old doesn't make it good.  If you want to bind local variables, you
> know where to find `let', don't you?

Lisp is rich in tradition and folklore.
We should not abandon them without much thought.

-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://openvotingconsortium.org
http://ffii.org http://mideasttruth.com http://honestreporting.com
If you have no enemies, you are probably dead.



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

* RE: 24.3.50; Use of deprecated ((lambda ...) ...) form
  2012-11-09 15:59 ` Stefan Monnier
  2012-11-09 16:15   ` Paul Eggert
  2012-11-09 16:38   ` Sam Steingold
@ 2012-11-09 16:50   ` Drew Adams
  2012-11-09 17:54     ` Stefan Monnier
  2 siblings, 1 reply; 12+ messages in thread
From: Drew Adams @ 2012-11-09 16:50 UTC (permalink / raw)
  To: 'Stefan Monnier', sds; +Cc: emacs-devel

> > why is ((lambda...)...) deprecated?
> Why not?

Really?  We're now deprecating things without giving any reason?

And instead we need to provide reasons _not_ to deprecate everything?
Deprecation by default?

> > this is one of the oldest lisp constructs!
> Old doesn't make it good.

Does old make it bad?  Is everything bad now, by default?  No need to say why
something is bad, in order to deprecate it?

This policy or way of proceeding seems quite misguided, if not downright wrong.
But maybe I'm missing something.




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

* Re: 24.3.50; Use of deprecated ((lambda ...) ...) form
  2012-11-09 16:38   ` Sam Steingold
@ 2012-11-09 17:05     ` Glenn Morris
  2012-11-09 19:22       ` Sam Steingold
  0 siblings, 1 reply; 12+ messages in thread
From: Glenn Morris @ 2012-11-09 17:05 UTC (permalink / raw)
  To: sds; +Cc: Stefan Monnier, emacs-devel

Sam Steingold wrote:

>> [ Please use M-x report-emacs-bug (or send it to
>>   bug-gnu-emacs@gnu.org). ]
>
> I thought that list was only for released versions.

Not since several years ago. And then there was emacs-pretest-bug, which
is now just an alias to it.



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

* Re: 24.3.50; Use of deprecated ((lambda ...) ...) form
  2012-11-09 16:50   ` Drew Adams
@ 2012-11-09 17:54     ` Stefan Monnier
  2012-11-09 19:43       ` Sam Steingold
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2012-11-09 17:54 UTC (permalink / raw)
  To: Drew Adams; +Cc: sds, emacs-devel

>> > why is ((lambda...)...) deprecated?
>> Why not?
> Really?  We're now deprecating things without giving any reason?

I did give a reason: because there doesn't seem to be any reason not to.

> And instead we need to provide reasons _not_ to deprecate everything?

Welcome to life.


        Stefan



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

* Re: 24.3.50; Use of deprecated ((lambda ...) ...) form
  2012-11-09 17:05     ` Glenn Morris
@ 2012-11-09 19:22       ` Sam Steingold
  0 siblings, 0 replies; 12+ messages in thread
From: Sam Steingold @ 2012-11-09 19:22 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Stefan Monnier, emacs-devel

> * Glenn Morris <etz@tah.bet> [2012-11-09 12:05:26 -0500]:
>
> Sam Steingold wrote:
>
>>> [ Please use M-x report-emacs-bug (or send it to
>>>   bug-gnu-emacs@gnu.org). ]
>>
>> I thought that list was only for released versions.
>
> Not since several years ago. And then there was emacs-pretest-bug,
> which is now just an alias to it.

I stand corrected and properly ashamed.

-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://www.memritv.org http://americancensorship.org
http://pmw.org.il http://openvotingconsortium.org http://think-israel.org
God had a deadline, so He wrote it all in Lisp.



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

* Re: 24.3.50; Use of deprecated ((lambda ...) ...) form
  2012-11-09 17:54     ` Stefan Monnier
@ 2012-11-09 19:43       ` Sam Steingold
  0 siblings, 0 replies; 12+ messages in thread
From: Sam Steingold @ 2012-11-09 19:43 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Drew Adams, emacs-devel

> * Stefan Monnier <zbaavre@VEB.HZbagerny.PN> [2012-11-09 12:54:10 -0500]:
>
>>> > why is ((lambda...)...) deprecated?
>>> Why not?
>> Really?  We're now deprecating things without giving any reason?
>
> I did give a reason: because there doesn't seem to be any reason not to.
>
>> And instead we need to provide reasons _not_ to deprecate everything?
>
> Welcome to life.

I just checked the calendar - it is _NOT_ April First.

-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://truepeace.org http://think-israel.org
http://americancensorship.org http://camera.org http://ffii.org
The software said it requires Windows 3.1 or better, so I installed Linux.



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

* Re: 24.3.50; Use of deprecated ((lambda ...) ...) form
@ 2012-11-10  0:05 Barry OReilly
  2012-11-10  1:59 ` Stefan Monnier
  2012-11-10  7:16 ` Stephen J. Turnbull
  0 siblings, 2 replies; 12+ messages in thread
From: Barry OReilly @ 2012-11-10  0:05 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

>> > why is ((lambda...)...) deprecated?

Is it because of this kind of inconsistency?

(funcall (lambda () (message "hi")))         ; Prints "hi"
(funcall (progn (lambda () (message "hi")))) ; Prints "hi"

((lambda () (message "hi")))                 ; Prints "hi"
((progn (lambda () (message "hi"))))         ; Lisp error:
(invalid-function (progn (lambda nil (message "hi"))))

One would hope either that the last two both work or both not work.

[-- Attachment #2: Type: text/html, Size: 1432 bytes --]

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

* Re: 24.3.50; Use of deprecated ((lambda ...) ...) form
  2012-11-10  0:05 24.3.50; Use of deprecated ((lambda ...) ...) form Barry OReilly
@ 2012-11-10  1:59 ` Stefan Monnier
  2012-11-10  7:16 ` Stephen J. Turnbull
  1 sibling, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2012-11-10  1:59 UTC (permalink / raw)
  To: Barry OReilly; +Cc: emacs-devel

BTW, if you like to put non-symbols at the head of expressions, you
might like to try M-: ((macro . eval) '(+ 1 2)) RET


        Stefan



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

* Re: 24.3.50; Use of deprecated ((lambda ...) ...) form
  2012-11-10  0:05 24.3.50; Use of deprecated ((lambda ...) ...) form Barry OReilly
  2012-11-10  1:59 ` Stefan Monnier
@ 2012-11-10  7:16 ` Stephen J. Turnbull
  1 sibling, 0 replies; 12+ messages in thread
From: Stephen J. Turnbull @ 2012-11-10  7:16 UTC (permalink / raw)
  To: Barry OReilly; +Cc: emacs-devel

Barry OReilly writes:
 > >> > why is ((lambda...)...) deprecated?
 > 
 > Is it because of this kind of inconsistency?
 > 
 > (funcall (lambda () (message "hi")))         ; Prints "hi"
 > (funcall (progn (lambda () (message "hi")))) ; Prints "hi"
 > 
 > ((lambda () (message "hi")))                 ; Prints "hi"
 > ((progn (lambda () (message "hi"))))         ; Lisp error:
 > (invalid-function (progn (lambda nil (message "hi"))))
 > 
 > One would hope either that the last two both work or both not work.

Where do you see an inconsistency?  A lambda expression is both
functionp and self-evaluating.  A progn is neither.  The first two
work because funcall evaluates its arguments, and they both evaluate
to a lambda expression.  The third works because a lambda expression
is functionp.  The fourth fails because a progn expression is not
functionp.

OIC, you think Emacs Lisp should be a Lisp-1.  I tend to agree, but it
ain't.  Sorry! :-)

I think Stefan misspoke when he said "if you want to bind locals, you
know where to find `let'."  I think what he really meant "if you want
code to look like Brainf!ck, you know where to find that language."

That is to say, as a matter of style for coding Emacs, I agree, such
expressions should be deprecated, as they are just a way for
old-timers and young pedants to show off.  On the other hand, they
express a deep truth about Lisp, and I would be saddened (and refuse
to follow suit where I actually have a say in the matter) if this
idiom were seriously deprecated in user code.




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

end of thread, other threads:[~2012-11-10  7:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-10  0:05 24.3.50; Use of deprecated ((lambda ...) ...) form Barry OReilly
2012-11-10  1:59 ` Stefan Monnier
2012-11-10  7:16 ` Stephen J. Turnbull
  -- strict thread matches above, loose matches on Subject: below --
2012-11-09 14:12 Sam Steingold
2012-11-09 15:59 ` Stefan Monnier
2012-11-09 16:15   ` Paul Eggert
2012-11-09 16:38   ` Sam Steingold
2012-11-09 17:05     ` Glenn Morris
2012-11-09 19:22       ` Sam Steingold
2012-11-09 16:50   ` Drew Adams
2012-11-09 17:54     ` Stefan Monnier
2012-11-09 19:43       ` Sam Steingold

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).