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

Re: Can one do the following in dylan?



On Tue, Mar 27, 2001, Bruce Hoult <bruce@hoult.org> wrote:

>But if you have dynamically loadable libraries then the init code in 
>those libraries should be adding appropriate methods to appropriate open 
>generic functions, including methods on "make()".  So if you then get 
>hold of a reference to a class object from that library -- perhaps as 
>the result of calling some function in that class -- then the client 
>code can happily create instances of that class.

How would you load an undetermined number of concrete subclasses of some
base class? I'm thinking of subclasses that are literally anonymous, or
at least whose names don't matter so that they might all have the same name.

For example, given a base class of <plug-in>, any number of plug in
classes could be created and compiled into dynamically loaded libraries,
possibly each one being implemented by filling out the skeleton code
provided with <sample-plug-in>.

Could you create a class at runtime, descended from <plug-in>? How would
you get generic functions on <plug-in> to dispatch to the subclasses?

I think there are two problems: getting the subclasses created, and
mapped into method dispatch?


Scott Ribe
scott_ribe@killerbytes.com
http://www.killerbytes.com/
(303) 665-7007 voice