(seen includes: anObject)
ifTrue: [ ^ self ].
anObject isNil
ifFalse: [ seen add: anObject ].
That part just tries to avoid to go into recursion if a described
object refers to another object that descriptions refer back to the
original object. That was requested at some point in the past, but I
never dependent on that myself.
Lukas
On 11 October 2010 11:49, Nick Ager <nick.ager(a)gmail.com> wrote:
> HI Lukas,
>
> On 11 October 2010 08:32, Lukas Renggli <renggli(a)gmail.com> wrote:
>>
>> Wow, that's a very nasty bug. Amazing that this hasn't hit anybody
>> before. Looks like this could happen quite common in systems like
>> Pier, not only with MABooleanDescription instances.
>>
>>
http://code.google.com/p/magritte-metamodel/issues/detail?id=7
>>
>> The validation code is really ugly. And likely this bug was introduced
>> when trying to support the validation for recursive structures. I
>> would be happy if someone could rewrite that code? (also get rid of
>> these nested, resumable exceptions).
>
> I'm happy to help, especially as I'd like a fix for the code I'm
> developing.
> However I'm struggling to understand the intent of the some of the code for
> example I don't understand the intent behind the use of object and previous
> in MAGraphVisitor>>#use:during
> MAGraphVisitor>>#use: anObject during: aBlock
> | previous |
(seen includes: anObject)
ifTrue: [ ^ self ].
anObject isNil
ifFalse: [ seen add: anObject ].
> previous := object. object := anObject.
> aBlock ensure: [ object := previous ]
> _______________________________________________
> Magritte, Pier and Related Tools ...
>
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>
--
Lukas Renggli
www.lukas-renggli.ch