[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Instance Variable Access
(1) instance variables
-- special syntax vs. ordinary symbols
-- semantics, when are defaults (if ever) copied down, active
access of IVs of other than self,...
It is clear to me if we are going to be able to allow different
experiments with how instance variables are implemented, then it is good
to make some syntactic distinction in their access form. Even Henry,
who uniformly prefers message call, uses a macro to hide that;clearly
(SEND self V1) looks uglier than (MY: V1).
Symbol macros automatically generated from lexical scope do the same
thing, but I think lose when trying to read the code. But surely that
can be another level of user option.
In terms of implementation, how an access is compiled (interpreted)
might be left to the class of the method. A computed macro for (MY: V1)
could simply do (SEND: (Class self) CompileGet 'V1), and
(SEND: (Class self) CompilePut 'V1 valueExpression)
for the (SETF (MY: V1) valueExpression). This allows not only
arbitrary experimentation between systems, but even mixing within a
single system. It would even allow for optimization by inclusion of a
mixin class for the class, etc.
One thing that is implicit in this description is that the class of an
object better be an object as well, prepared to receive at least
CompilePut, ... messages. This is not now true for classes in some of
the systems being discussed. Is this important?