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

Re: [Q] Dylan to Java/JVM compiler?



Lieven Marchand mal@wyrd.be on  2001-05-08 17:15 wrote:

> <off-topic> 
> BTW, why does LispWorks complain about the equivalent CL code? The
> Hyperspec specifically allows users to augment the MAKE-INSTANCE
> generic function.
> 
> CL-USER 8 > (defmethod make-instance ((class (eql (find-class 'abstract)))
> &rest args)
>             (apply #'make-instance 'concrete args))
> 
> Error: Defining method #<STANDARD-METHOD MAKE-INSTANCE NIL ((EQL
> #<STANDARD-CLASS ABSTRACT 21151714>)) 204D8444> visible from packages
> COMMON-LISP.
> 1 (continue) Define it anyway.
> 2 Discard the new method.
> 3 (abort) Return to level 0.
> 4 Return to top loop level 0.
> 
> It works as expected when you choose restart 1.
> </off-topic>

Because you have now made make-instance generic, potentially slowing down
other calls to make-instance, throughout your program.

Dylan can avoid some of this inefficiency by appropriate sealed
declarations.  In particular, I believe make-instance, while open, is sealed
over all built-in classes.



References: