3 ms·
> I'm having a hard time figuring out a base case for say calling toString on an object, or incrementing an integer. In both cases, we can special-case the "ze
by falcor84 9y ago
> I'm having a hard time figuring out a base case for say calling toString on an object, or incrementing an integer.
In both cases, we can special-case the "zero" of the domain. For example, toString of an object without any attributes would return '{}', while incrementing the integer zero would return 1.
I'm not sure about the usability of the latter in an iterative approach, but the former could definitely be used as the basis of an iterative algorithm that traverses all of an object's attributes.