On Mon, 26 Dec 2011 19:00:57 -0800, Andrei Alexandrescu 
<seewebsiteforem...@erdani.org> wrote:

On 12/26/11 7:49 PM, Andrej Mitrovic wrote:
On 12/27/11, Andrei Alexandrescu<seewebsiteforem...@erdani.org>  wrote:
We can easily have opDispatch look at field names. But I think it's poor
design to expose bald data anyway.

opDispatch doesn't work with property functions,

It actually does, as per the unittests. Even if it currently does by
@property being too lax, it should continue to work.

Currently, if opDispatch is only templated on a string, property assignment 
(i.e. foo.x = 1) syntax works. If opDispatch is templated on more than the 
method name, DMD 2.057 ICEes.

or opBinary,

Should work, as operators are just translated to regular methods.

or
opOpAssign.

Should work.

But not in practice yet; DMD still treats opBinary, opAssign, etc as being 
special and doesn't forward them to opDispatch. However, it's straightforward 
to manually define them yourself.

Reply via email to