[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Common Lisp solved this problem 20 years ago
Alan Watson wrote:
I have realized (remembered?) that type specifiers are only one of the
ingredients in this particular recipe for solving this problem.
For example, consider the following in Kawa's notation:
(lambda (x :: <flonum> y :: <flonum>) :: <flonum>
(/ x y))
Unless the compiler can be sure that / is the standard division
procedure, there is not much it can do.
Of course, module systems often allow the compiler to figure out what /
really is, and a module system will come fitted as standard in R6RS.
Common Lisp allows a compiler to *assume* / is defined to the standard
/ operation, unless there is a visible re-definition.
Kawa makes more-or-less the same assumpions.
I think that is a reasonable default mode for a compiler.
Also note I am assuming "compatible run-time typing" and behavior: