[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lexical mumblings
From: |
Miles Bader |
Subject: |
Re: lexical mumblings |
Date: |
19 Oct 2001 17:41:31 +0900 |
address@hidden (Gerd Moellmann) writes:
> > Of course, the byte-compiler would know that lambda expressions only
> > used by `well-behaved' functions like mapcar can't escape, and so
> > can use the stack-allocated variable-frame.
>
> Just a nit
>
> (defvar g)
> (defun f (x) (mapcar (setq g (lambda (e) x)) '(1 2)))
> (f 2)
> (funcall g 1) => ?
In this case, the lambda isn't passed to mapcar, it's passed to setq.
So the compiler would generate a heap-allocated closure, and the
(funcall g 1) would yield `2'.
-Miles
--
Saa, shall we dance? (from a dance-class advertisement)
- lexical mumblings, Miles Bader, 2001/10/18
- Re: lexical mumblings, Gerd Moellmann, 2001/10/19
- Re: lexical mumblings,
Miles Bader <=
- Re: lexical mumblings, Andrew Innes, 2001/10/19
- Re: lexical mumblings, Richard Stallman, 2001/10/19
- Re: lexical mumblings, Kai Großjohann, 2001/10/19
- Re: lexical mumblings, Miles Bader, 2001/10/19
- Re: lexical mumblings, Richard Stallman, 2001/10/21
- Re: lexical mumblings, Miles Bader, 2001/10/24
- Re: lexical mumblings, Richard Stallman, 2001/10/25
- Re: lexical mumblings, Miles Bader, 2001/10/25
- Re: lexical mumblings, Stefan Monnier, 2001/10/26