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

[Reducible declaration? and] Constant-Function



re: I think there should be some way to closely associate global 
    declaration-type stuff with a function's definition.   . . . Of course, 
    the world will not come to an end because people have to use a separate
    proclaim.  I just think it would be nicer to put everything
    about a function definition into a single form.

This is a very good point.  Perhaps the bottleneck is that CL can't
agree to semantics for *any* declaration (except for SPECIAL); some
compiler's basically throw all declarations away (except for SPECIAL).


re: Another solution is to define a macro encapsulaing the DEFUN and
    PROCLAIM. . . .  I also don't have a good name for such a macro.  
    'Defconfun' is rather bletcherous.  'define' would do, but Sussman's 
    students would start schemeing against me.

Part of the problem I've been having with the "constant function" declaration
is it's vagueness.  In your original message you characterized it as "won't 
redefine the function at runtime"; but as subsequent dialogue shows, there is
very little feeling that that implies anything worthwhile beyond what the 
existing declarations (like ftype, speed/safety etc) provide.  "Never 
redefine, at all, ever" is just too stringent to be useful.

Further, my assumption that "Never redefine"  characterizes the meaning
you intended seems to have caused confusion, as evidenced by replies by 
others; in particular, some (perhaps yourself?) are primarily concerned 
with the stability of the argument spectrum, so that a compiler *might* 
be licensed to use a different function-to-function protocol.  Maybe I'm 
confused here too, in which case I'll just drop this line of reasoning; but 
isn't argument spectra information is already specifiable via the ftype 
declaration?


I tried to suggest that maybe you wanted to cover the case that is currently
not covered by any CL declaration -- that of "constant folding" (barmar
called it "reducible";  but his example failed to fold the constant form --
it only coalesced common subexpressions).  Such "constant folding" at compile
time is a critical component of Lucid's optimizing compiler; but the data-
base of what is "foldable" isn't user-accessible.  There is currently no CL 
declaration that covers this case.  Accepting barmar's terminology, I see a 
reasonable place for a REDUCIBLE declaration; would you?


-- JonL --