[Ecls-list] Status of CVS

Gabriel Dos Reis gdr at integrable-solutions.net
Thu May 15 06:45:31 UTC 2008

On Tue, May 13, 2008 at 7:15 AM, Juan Jose Garcia-Ripoll
<jjgarcia at users.sourceforge.net> wrote:
> On Tue, May 13, 2008 at 1:04 PM, Gabriel Dos Reis
> <gdr at integrable-solutions.net> wrote:
> >  So, what is your take on function type proclamation?
>  >  (OpenAxiom uses it a lot).
>  It's not my take, but if we are to be consistent with how other lisps
>  behave, these proclamations can be used at any time, but they will
>  only buy you something for user functions at safety 0. In this case,
>  the user is really saying: I will pass you the right data. If he/she
>  does not , then the outcome of the computation is really undefined, as
>  the compiled code  might be directly accesing a slot that does not
>  exist, or doing something like that. If safety > 1, the function will
>  have a CHECK-TYPE form at the entrance anyway, so it does not matter
>  whether there was a proclamation or not.

Some Lisps (e.g. CLisp) just ignore the declaration outright; others (e.g. SBCL)
do take them into consideration (cross checking + optimization for calling
convention), so it is natural to wonder what ECL's consistent choice would be.

>  A completely different thing are functions from the Lisp core that can
>  be inlined depending on the safety settings. ECL has a lot of them.
>  They can be transformed into different C statements depending on the
>  type of the arguments. Again, if we are to be consistent with the
>  previous behavior, the unchecked forms should only be activated at
>  safety = 0. The forms that work for all types can be inlined always
>  unless the settings are DEBUG > 1.


>  Finally we have unboxed functions. Once they are implemented they will
>  be the only ones that will really profit from type proclamations. The
>  question is, at what level of safety should we implement those
>  functions? For consistency, if at safety = 1 we are inserting
>  check-type forms because we do not believe the types of the arguments,
>  they should only work at safety = 0.


>  Note that here I am not expressing the behavior that _I_ would like or
>  prefer. The previous line of thought is what I conclude from looking
>  at what kind of code the SBCL compiler is producing at different
>  safety levels (*) and thereby extracting what other people might
>  expect. Indeed, when I initiated this thread was to gather information
>  about your expectations, not to fight about what is right or wrong.

There was no implication that you would be fighting for `right' or `wrong',
but it is important to know what the doer would prefer even when users
agree and disagree.

-- Gaby

More information about the ecl-devel mailing list