Better put a placeholder in the cache and then do a oneWayBecome
afterwards.
cache at: key ifAbsent: [
cache at: key put: (placeholder := Object new).
cache at: key put: (newValue := (self build: anObject)).
placeholder oneWayBecome: newValue ].
And if you want it bullet proof, you use Meta's MessageRecorder :)
cheers,
-- Adrian
On 13 Feb 2007, at 22:24 , Lukas Renggli wrote:
So I decided
to change Magritte not to do infinite recursion. I
changed
MADescriptionBuilder>>for: anObject
^ cache at: anObject ifAbsent: [
cache at: anObject put: true.
cache at: anObject put: (self build: anObject).
].
Looks like an interesting trick, but don't you then end up with the
value true in some of your meta-models? Wouldn't it make more sense
to use nil instead?
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki