unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Constantin Kulikov <zxnotdead@gmail.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: Lambda in macrolet becomes a closure? (another breaking change in emacs:))
Date: Tue, 27 Sep 2016 16:57:46 +0200	[thread overview]
Message-ID: <87r3851jbp.fsf@web.de> (raw)
In-Reply-To: <CAFkz2yr_-6NtNW69hVSdKbs5Ki-eTcWJDfkAnU4EWkaDVhTtyw@mail.gmail.com> (Constantin Kulikov's message of "Tue, 27 Sep 2016 14:53:18 +0300")

Constantin Kulikov <zxnotdead@gmail.com> writes:

> Also, by looking at `minibuffer-with-setup-hook' [...]  There is no
> quotation of the fun, funsym or hook. Is it correct?

A good question.  But I think the definition is correct in this regard.

FUN is (bound to) an expression (since `minibuffer-with-setup-hook' is a
macro and FUN is just "pasted" into the expansion without evaluation).

If you look at the expansion (let's use a lambda form as FUN):

#+begin_src emacs-lisp
(macroexpand-1
 '(minibuffer-with-setup-hook
      (lambda () (do-some-setup))  do-this do-that))
==>
(let
    ((#2=#:fun
      (lambda nil
        (do-some-setup)))
     #1=#:setup-hook)
  (setq #1#
        (lambda nil
          (remove-hook #3='minibuffer-setup-hook #1#)
          (funcall #2#)))
  (unwind-protect
      (progn
        (add-hook #3# #1#)
        do-this do-that)
    (remove-hook #3# #1#)))
#+end_src

you see that nowhere a function value is evaluated.  In some cases, a
function expression is bound to a symbol (`let', `setq'), in the other
cases, the code refers to the binding of these symbols.


Michael.



      reply	other threads:[~2016-09-27 14:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-19 16:43 Lambda in macrolet becomes a closure? (another breaking change in emacs:)) Constantin Kulikov
2016-09-19 18:12 ` Stefan Monnier
2016-09-23 16:01   ` Michael Heerdegen
2016-09-23 16:13     ` Stefan Monnier
2016-09-23 17:19 ` Constantin Kulikov
2016-09-23 19:03   ` Stefan Monnier
2016-09-25 11:06     ` Constantin Kulikov
2016-09-25 14:15       ` Stefan Monnier
2016-09-25 18:01   ` Michael Heerdegen
2016-09-25 18:53     ` Stefan Monnier
2016-09-27  9:13     ` Constantin Kulikov
2016-09-27  9:19       ` Constantin Kulikov
2016-09-27 11:53         ` Constantin Kulikov
2016-09-27 14:57           ` Michael Heerdegen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r3851jbp.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=zxnotdead@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).