Hi Keith,
I am having a look at the implementation of
MADynamicObject and I was
wondering if you could help me by explaining to me how it works!
It is a bad thing, but very convenient.
I can see that MADynamicObject on: [ 123 ]
should assign the BlockContext [123 ] to be the realSubject of the
MADynamicObject.
It is used to put a calculated value into a variable. Whenever you
send the first message to it, the block gets evaluated and the
message is performed on the result. It is sometimes convenient to do
this, such as for the options of a single-selection description that
should return a list of currently loaded classes and not a list of
classes that have been available when the description was cached.
As usual with proxies it creates more troubles than it helps. I have
some ideas to avoid them altogether in a future version of Magritte.
What I am failing to understand is at what stage the
block is
evaluated.
I can see that whenever a message is sent to the MADynamicObject it is
being evaluated before the message is sent. I just cant see where the
code is that does the #value.
What I find strange is that a MADynamicObject is ending up in the
code to serialize. Actually that should not happen, as these are only
part of a few descriptions that should remain transient. Can you tell
me the path of references from the object you serialize to the
instance of MADynamicObject?
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch