On 2009-08-02 15:07:37 -0400, Michiel Helvensteijn
<[email protected]> said:
In my design, they are actual functions with actual names.
For D this doesn't really work. If you want symbolic placeholders, you may
want to use something other than 'get' and 'set'. For example, 'in'
and 'out' have been suggested by some. They are already keywords.
One thing with in and out makes me uneasy. Imagine a setter/getter with
a contract:
int prop.out()
out (result) { assert(result > 3); }
body { return something; }
void prop.in(int v)
in { assert(v > 3); }
body { something = v; }
Wouldn't it be a little confusing having twice the same keyword so
close but with a completly different meaning?
--
Michel Fortin
[email protected]
http://michelf.com/