Possible @property compromise

TommiT tommitissari at hotmail.com
Sat Feb 2 19:15:54 PST 2013


On Sunday, 3 February 2013 at 02:55:44 UTC, Zach the Mystic wrote:
> Well, if you want access to a struct from outside, save 
> yourself the time and put it outside to begin with. A nested 
> struct of course is directly related to the entity it finds 
> itself in. My pet metaphor is struct Dog containing struct 
> Tail. It would definitely be illogical to put the Tail outside 
> the Dog.

If Tail is an autonomous struct/class, then it totally makes 
sense to put the definition of Tail outside of dog. This enables 
you to perhaps use the same Tail in Wolf's and Hyeena's 
definitions. If, on the other hand, Tail is not an autonomous 
type, but rather, needs to able to wag the dog, then Tail is 
really more like a separate logical section within Dog's 
definition, i.e. a namespace within Dog.


More information about the Digitalmars-d mailing list