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

Constant Functions



I think you may have missed the thrust of my critique of Eliot's proposal.
It sarted out like this:
    Isn't it the case that *any* proclaim about a function is equivalent to
    saying that that aspect of the function is "constant"?  
Basically, a compiler can't make *any* assumptions at all about a function 
it is compiling a call to without assuming "constant-function" also.  This
is as true of FTYPE and INLINE declarations as it would be for the more 
limiting items you mention like number of required arguments, etc.

Similarly, an INLINE declaration must already imply "constant function";
but my critique claims that a general "constant function" declaration must 
not by itself imply INLINE.

Of course, it should be ok to redefine a "constant function" providing the 
particular assumptions made during compilation aren't changed.  That leaves
very little you can do to a function that has been inline'd.


re: That's already not true of the VALUES declaration.  It specifies an
    attribute of the function being defined, just as Eliot was suggesting
    above.

CLtL, p162 speaks of the VALUES declaration; it says nothing at all like
that.  Would you like to try again to say what you meant?  Remember also 
that Eliot was suggesting that a such a declare be equivalent to a proclaim
(which modifies a global database) and that would give it indefinite scope;
but every other declare is lexically scoped.


-- JonL--