From: Trent Lange
Subject: Re: Some benchmark results ...
Date: 
Message-ID: <1991Oct25.002254.9678@cs.ucla.edu>
In article <····@skye.ed.ac.uk> ····@aiai.UUCP (Jeff Dalton) writes:
>
>[...] Not only that, the
>meaning of function declarations has changed in CLtL II.  It used
>to be that (function (fixnum) fixnum) meant "if the arg is a fixnum,
>the result is one"; in CLtL II it means "the function will be called
>with a fixnum and will return a fixnum".

I suppose this move made sense in order to keep declarations of function
types analogous to other types of declarations.  However, the change really
limits the expressive power of declarations.  Many is the time I've
wanted to inform the compiler that if a certain function receives fixnum
arguments it should return a fixnum value, but if it recieves float arguments
it should return a float value, and so on.  Any halfway smart compiler
should be able optimize code with such declarations.

It's especially a problem in terms of generic-functions in CLOS.  When
one is defining a specialized method, one would like to be able to declare
the types of its return values (actually its generic-function's return
values), without necessarily knowing the declaration of the same methods
on different classes.  With CLtL II, that's impossible, since a new
declaration for the method's generic-function ftype would clobber any
old declarations.

I suppose the ideal would be to have the function declaration scheme of
CLtL II to define the "base types" that all calls of a function must
comply with, and some additional declaration mechanism to allow specialized
declarations to be made.

- Trent Lange