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

Constant Functions

Received: from labrea.stanford.edu by SAIL.Stanford.EDU with TCP; 9 May 88  14:20:09 PDT
Received: by labrea.stanford.edu; Mon, 9 May 88 14:20:14 PDT
Received: from bhopal.lucid.com by edsel id AA23164g; Mon, 9 May 88 13:57:53 PDT
Received: by bhopal id AA12572g; Mon, 9 May 88 14:00:48 PDT
Date: Mon, 9 May 88 14:00:48 PDT
From: Jon L White <edsel!jonl@labrea.stanford.edu>
Message-Id: <8805092100.AA12572@bhopal.lucid.com>
To: barmar@think.com
Cc: ELIOT@cs.umass.edu, common-lisp@sail.stanford.edu
In-Reply-To: Barry Margolin's message of Sun, 8 May 88 00:07:09 EDT <8805080407.AA26147@fafnir.think.com>
Subject: Constant Functions

re:  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.

    This is not true.  If there has been an FTYPE declaration, the
    compiler may make assumptions about the types of arguments and values
    of a function, but certainly not about the implementation.

I fail to see your point, since the compiler will also have to assume that
the function won't be redefined incompatibly.  I hate to keep harping on a
point, but the first two lines I sent out on this topic say just about
all there is to be said:
    Isn't it the case that *any* proclaim about a function is equivalent to
    saying that that aspect of the function is "constant"?  

Comments by Zacharis and Hornig also confirm that CONSTANT-FUNCTION as a 
declaration gives you nothing beyond what is already implicit in the 
collection of INLINE, FTYPE etc.; and CONSTANT-FUNCTION by itself cannot 
substitute for any one of them individually.  I particularly like Hornig's
explanation that unless the user explicitly declares a name NOTINLINE,
the symbolics compiler will make whatever assumptions of constantness it 
feels like.  You may not even know which aspect is relevant.

-- JonL --