emacs-devel
[Top][All Lists]
Advanced

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

Re: Lambda in macrolet becomes a closure? (another breaking change in em


From: Constantin Kulikov
Subject: Re: Lambda in macrolet becomes a closure? (another breaking change in emacs:))
Date: Fri, 23 Sep 2016 20:19:36 +0300

Thanks for the explanation.

However:

> To quote a value, you want to use `quote` rather than `function`. 

I tried something different:

(setq lexical-binding t)
(let ((var 1))
        (let* ((fu #'(lambda (a) (+ a var)))
               ba)
          (message "%s" `,fu)
         (setq ba (byte-compile `(lambda (b) (funcall (quote ,fu) b))))
         (funcall ba 2)))

and it seems to work well,  but 

(setq lexical-binding nil)
(let* ((fu #'(lambda (a) (+ a 1)))
               ba)
          (message "%s" `,fu)
          (let (byte-compile-warnings)
           (setq ba (byte-compile `(lambda (b) (funcall (quote ,fu) b)))))
         (funcall ba 2))

 results in a *Compile-Log* buffer pop up with

Warning: (lambda (a) ...) quoted with ' rather than with #'

So (if I understend correctly) I can not predict that the value of the `fu' will be a (closure ...) or a (lambda ...), then how I can decide how to quote this value or silence the warning?

reply via email to

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