[phobos] Time to get ready for the next release

Michel Fortin michel.fortin at michelf.com
Thu Apr 21 13:12:39 PDT 2011


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
michel.fortin at michelf.com
http://michelf.com/





More information about the phobos mailing list