[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: ELIOT@cs.umass.edu
- Subject: Constant-Function
- From: Jon L White <firstname.lastname@example.org>
- Date: Tue, 10 May 88 19:20:10 PDT
- Cc: email@example.com
- In-reply-to: ELIOT@cs.umass.edu's message of Tue, 10 May 88 15:44 EDT <8805102203.AA28707@edsel.lucid.com>
re: Knowing the FTYPE of sqrt does not allow a compiler to substitute 2.23 for
(sqrt 5). You might redefine SQRT as SIN without violating the FTYPE.
Right. So your intention for "constant function" really was more along the
line of "constant foldable" (or "reducible"), just as I guessed in my first
In fact, "constant function" by this definition doesn't even imply a
constant argument sepectrum. Imagine a function (defun foo (x y) ...)
which is "folded" as follows: (foo 2 3) --> 5; then at runtime the user
redefines it as (defun foo (x y &optional z) ...) in such a way that
(foo 2 3) = (foo 2 3 nil) = 5. No violation of compiler optimizations.
re: Some Symbolics users use ' in place of #' to get around this bug. (!)
I think it exists exactly because the 'constant-function' declaration
is missing, . . .
Well, Hornig did mention, and others concurred, that the much more common
case is to want this assumption; and having to place extra declarations
around all the common cases would be a pain.
-- JonL --