In serialization, when you substitute an object by another, such
substitution(*) is then serialized using the same rules, so you might
need the guard condition to avoid the infinite loop.

This was the simpler implementation, but maybe it's undesirable or it's
too error prone. Do you think we should change this?

Probably, the right answer is to allow a choice of whether or not the substituted object(s) are subject to further substitution. And, no matter which choice is made, no infinite loop should occur -- a tall order.


But if the choice made is to let substituted objects to be substituted again, then a loop may happen, and Fuel cannot control/detect that. Maybe the default value should not allow substituting substituted objects?



*: note the substitution can be not just an object but a graph of
objects, some of them able to be substituted too.

Good to know this.





--
Mariano
http://marianopeck.wordpress.com