You may be interested in To Validate Data In Lvalue Subs. There I demonstrate a way to enforce constraints on data accessed by closures on it in lvalue subs. The key was to wedge the constraint test into assignment and friends by tieing the cloistered scalar to a 'Constraint' class.
Don't worry too much about speed; if you have constraints that must be tested, you need correctness and completeness more than speed.
After Compline,
Zaxo
In reply to Re: Encapsulation without methods
by Zaxo
in thread Encapsulation without methods
by Roy Johnson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |