unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* What does byte-compile a variable containing a lambda do?
@ 2009-06-03  2:00 Lennart Borgman
  2009-06-03  8:45 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Lennart Borgman @ 2009-06-03  2:00 UTC (permalink / raw)
  To: Emacs-Devel devel

The help text for byte-compile says

    byte-compile is a compiled Lisp function in `bytecomp.el'.

    (byte-compile form)

    If form is a symbol, byte-compile its function definition.
    If form is a lambda or a macro, byte-compile it as a function.

I do not understand the last sentence. What happens? If a variable
contains a lambda and you do

    (byte-compile VAR-WITH-LAMBDA)

what happens? Is the content of the variable changed or does
byte-compile return something?




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

* Re: What does byte-compile a variable containing a lambda do?
  2009-06-03  2:00 What does byte-compile a variable containing a lambda do? Lennart Borgman
@ 2009-06-03  8:45 ` Andreas Schwab
  2009-06-03  9:28   ` Lennart Borgman
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2009-06-03  8:45 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

Lennart Borgman <lennart.borgman@gmail.com> writes:

> The help text for byte-compile says
>
>     byte-compile is a compiled Lisp function in `bytecomp.el'.
>
>     (byte-compile form)
>
>     If form is a symbol, byte-compile its function definition.
>     If form is a lambda or a macro, byte-compile it as a function.
>
> I do not understand the last sentence. What happens? If a variable
> contains a lambda and you do
>
>     (byte-compile VAR-WITH-LAMBDA)

Since byte-compile is a regular function, it can only see the value it
gets passed.  So unless you pass it a symbol (first case) it can only
return the byte compiled form without side effect.

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

* Re: What does byte-compile a variable containing a lambda do?
  2009-06-03  8:45 ` Andreas Schwab
@ 2009-06-03  9:28   ` Lennart Borgman
  0 siblings, 0 replies; 3+ messages in thread
From: Lennart Borgman @ 2009-06-03  9:28 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Emacs-Devel devel

On Wed, Jun 3, 2009 at 10:45 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Lennart Borgman <lennart.borgman@gmail.com> writes:
>
>> The help text for byte-compile says
>>
>>     byte-compile is a compiled Lisp function in `bytecomp.el'.
>>
>>     (byte-compile form)
>>
>>     If form is a symbol, byte-compile its function definition.
>>     If form is a lambda or a macro, byte-compile it as a function.
>>
>> I do not understand the last sentence. What happens? If a variable
>> contains a lambda and you do
>>
>>     (byte-compile VAR-WITH-LAMBDA)
>
> Since byte-compile is a regular function, it can only see the value it
> gets passed.  So unless you pass it a symbol (first case) it can only
> return the byte compiled form without side effect.

Yes, but in the first case in the doc string it byte compiles the
function definition "in place". In the second case I think it should
say that it returns the byte compiled function, or?




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

end of thread, other threads:[~2009-06-03  9:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-03  2:00 What does byte-compile a variable containing a lambda do? Lennart Borgman
2009-06-03  8:45 ` Andreas Schwab
2009-06-03  9:28   ` Lennart Borgman

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