emacs-devel
[Top][All Lists]
Advanced

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

Re: byte-opt.el addition - optimize list of compile-time constants


From: David Kastrup
Subject: Re: byte-opt.el addition - optimize list of compile-time constants
Date: Thu, 09 Dec 2004 10:20:18 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Zack Weinberg <address@hidden> writes:

> Miles Bader <address@hidden> writes:
>
>>> >> I thought the whole point of (function ...) was to assert that the
>>> >> lambda expression it contains *will* be used by execution.
>>> >
>>> > Yes, but that only applies if it occurs in an evaluable context.
>>> > Anyplace else, all bets are off.
>>> 
>>> That strikes me as just plain silly.  What's the point of a hint if it
>>> doesn't always mean what it means?
>>
>> If there's a random arbitrary list constant in some code, how on
>> earth is the compiler supposed to tell what the intended meaning of
>> sub-components of the list are?!?
>
> By reference to the language definition.  That's really what we're
> quibbling about here - I'm saying the language should be defined
> such that (function (lambda ...)) should indicate a function
> constant even if arbitrarily nested within a (quote ...) form,
> you're saying it shouldn't.

Of course it shouldn't.  The purpose of quote is not to execute.
`function', when _executed_, creates a quoted function object, just
like `quote', when _executed_, creates a quoted data object.

If you write '(woozle '(woozle)), the inner `quote' gets retained and
does nothing, like I would expect from an inner `function'.

> In evidence for my position I would like to point out that it is
> silly for '(1 2 3 #'(lambda ...) 4 5 6) to mean something different
> than (list 1 2 3 #'(lambda ...) 4 5 6),

Says who?

> and the byte compiler compiles the embedded lambda in the second
> case, so logically it ought to in the first case as well.
>
> Also, in Common Lisp the situation is clearly that the compiler _is_
> entitled to compile (function ...) wherever it finds it

This would surprise me.

bash-3.00$ gcl
GCL (GNU Common Lisp)  Version(2.5.0) Wed Oct  9 10:33:12 CEST 2002
Licensed under GNU Library General Public License
Contains Enhancements by W. Schelter

>(setq zap '(1 2 3 (function (lambda (x) x))))

(1 2 3 #'(LAMBDA (X) X))

>(setq zap (list 1 2 3 (function (lambda (x) x))))

(1 2 3 (LAMBDA-CLOSURE () () () (X) X))


-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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