Bob Rogers <[EMAIL PROTECTED]> wrote:
FWIW, the Common Lisp system I'm writing takes a third tack.  It defines
a ParrotObject container associated with the name that refers indirectly
to the current value.  Of course, Common Lisp "symbol" objects are part
of the language spec (and aliasing is not), so I have to at least make
it look like I'm doing it this way.  But indirection still seems more
natural than morphing -- I don't have to worry about whether morphing
will produce unintended side-effects.  And the best thing is that I can
do it all in PIR and Lisp.

   So when I said "using PMCs as values rather than as containers," I
really meant to suggest separating the container from the value.  But I
have no clue whether this would be easier than the other options.
Okay, that makes much more sense. It's not ideal, especially for Tcl,
but it does work. Technically, any time we use something other than a
TclString PMC it's an optimization.
After looking at the code in the Array, Scalar, and String PMCs, I've
managed to get things working to my satisfaction using an
iterate-and-copy method for array-like objects and morphing for
Strings (and soon for other types as well).

So if anyone ever finds himself or herself in the same position, a
look at TclList's (languages/tcl/src/pmc/tcllist.pmc) assign_pmc
method would probably be in order.
--
Matt Diephouse
http://matt.diephouse.com

Reply via email to