Re: Common Lisp solved this problem 20 years ago Alan Watson 26 Oct 2005 03:52 UTC

Aubrey Jaffer wrote:
> Are you suggesting that we have syntax specific to the SRFI-77
> categories; or a general type declaration system?

If type inference is a general problem, why not provide a general solution?

Or, if a general type mechanism is too radical, why not use a subset to
solve the particular problem for arithmetic in R6RS and leave the rest
to R7RS. If you have forms that declare certain named variables are
fixnums/flonums and that certain expressions yield fixnums/flonums, you
are most of the way there. These can probably be provided in a way that
can be transparently extended to real types.

> Specific sounds good to me.  Can you propose a specific set of
> syntaxes?

There are examples of type declarations in Common Lisp, Dylan, Kawa,
Bigloo, and I am sure other lisps. Let's look at them before we try to
invent something new.

Per, would you summarize the syntax and semantics of type declarations
in Kawa, please?

Regards,

Alan
--
Dr Alan Watson
Centro de Radioastronomía y Astrofísica
Universidad Astronómico Nacional de México