in reply to Encapsulation without methods
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Encapsulation without methods
by Roy Johnson (Monsignor) on Jun 22, 2004 at 16:03 UTC | |
by Plankton (Vicar) on Jun 23, 2004 at 07:03 UTC |