Le 2011-04-21 à 15:41, David Simcha a écrit :

> How about the amount of existing code it breaks?

Enforcing @property breaks a lot of code, that's a fact. Just look at what I 
needed to do to druntime and Phobos to make them compile:

<https://github.com/michelf/druntime/compare/master...@property>
<https://github.com/michelf/phobos/compare/master...@property>

(Note: work on Phobos is incomplete.)

What it breaks is generally simple to fix: a missing @property here, wrong call 
syntax used there...

One other thing is sure, the more time it takes before DMD enforces it the more 
code will break the day it starts enforcing it. That's simply because more code 
will have been written.


> How about the fact that it breaks using the same function for both method 
> chaining and with property syntax?

Just use "with":

        with (new Album) {
                name = "hello";
                author = "me";
                group = "them";
                save("/musicinfo/hello.album");
        }

Much cleaner than forcing setters to return the underlying object.

-- 
Michel Fortin
[email protected]
http://michelf.com/



_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to