From: Nikodemus S. <tsi...@cc...> - 2005-11-04 08:30:19
|
On Fri, 4 Nov 2005, James Y Knight wrote: > So I'd like to make constantp return t more often, in particular, cases like > It seems like the nicest way to do that may be to IR1-compile the argument, > and then check the IR1 output to see if it looks like a constant function. Sounds like a shitload of work for CONSTANTP. ;-) For testing the constantness of complex form I think an evaluator-like approach might be better: 1) macroexpand the form 2) if a function call, is this function foldable? 3) if foldable, are all the arguments constant? Much less work then compiling the form, and arguably cleaner too. Cheers, -- Nikodemus Schemer: "Buddha is small, clean, and serious." Lispnik: "Buddha is big, has hairy armpits, and laughs." |