In my SemiTwist D Tools project ( http://www.dsource.org/projects/semitwist ), I have a util mixin to DRY-ly create a publically-readonly property with backing storage (actually, I've had it for awhile, but I've been toying with it again recently).
1. It can optionally give the backing storage any access level you want, but what I'm wondering is, what do you think would be a better default: private or protected? 2. As a secondary question, do you think 'getter', 'readonly' or something else would be the best name for it? 3. There's an alternate version that creates a getter that, instead of returning the backing storage, works like this: On the first call, a user-supplied function is called that generates the value. This value is automatically cached and returned. Subsequent calls return the cached value until the private (or protected) 'cached' flag is cleared. What would be a good name for this util? 'getterLazy', 'getterCached', 'readonlyLazy', 'readonlyCached', etc..., or just simply overload the regular 'getter'/'readonly'/etc...? 4. Do you think this util would be a useless waste, or potentially handy? My main interest is Q #1, but I'm curious about opinions on the others too.
