This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: prototype object semantics
- To: John Kozak <jk at thameslighter dot net>
- Subject: Re: prototype object semantics
- From: Per Bothner <per at bothner dot com>
- Date: Mon, 12 Nov 2001 18:46:39 -0800
- Cc: kawa at sources dot redhat dot com
- References: <15342.51210.796000.800816@thameslighter.net>
John Kozak wrote:
>Question: morphic is very objecty, but works best with prototype
> rather than class based semantics. Just looking very superficially,
>it seems prototypes could be embedded into the kawa class universe
>reasonably cleanly: e.g. perhaps have a class called <PrototypeRoot>
>which has methods
> (add-slot! (name :: <java.lang.string>))
> (add-method! (name :: <java.lang.string>) code) ;; need this?
> (clone)
>create a single object of <PrototypeRoot>, then all new prototype
>semantics objects just clone and modify recursively off this. Is this
>a demented idea?
>
Well, the Kawa class universe is rather tied to classes that have
slts and methdos known at compile-time. Of course compile-time
can also be run-time in Kawa.
I guess you could re-define various Kawa primitives to call some a
special interface method if an object implements PrototypeRoot,
and call reflection otherwise. Or vice versa.
--Per Bothner