Another option -- put the code in as an optional build parameter for dmd. Then people who want to get phobos ready can build their own dmd copy to work on the issues. These should be easy, but mostly busywork, because the compiler will simply complain when something is invalid. They'll all be pretty much 3-second bugs :)
And as far as "design by newsgroup" I think almost all the new features were vetted on the newsgroup at one point, including inout. It's unfair to simply point to ones you disagree with as evidence of failure ;) In defense of @property, I think we all agree we needed something to distinguish setters from single-arg functions. I think with a reasonable rule, we can allow calling no-arg functions without parens (via a proposal I made earlier that as long as the function returns void, it should be allowed). All that's left is actual property getters. I can't say enough that @property in those cases has nothing to do with functionality and everything to do with human interpretation. Like it or not, the use of parentheses is an extension of the function name, whose semantic meaning of course is unenforceable. But just allowing the user to decide whether something is a property or a function leaves the interpretation up to the user, taking all the power away from the author who wrote the function. @property is a clarification tool, and by necessity, is implemented via convention rather than compiler enforcement. -Steve ----- Original Message ---- > From: Andrei Alexandrescu <[email protected]> > To: Discuss the phobos library for D <[email protected]> > Sent: Wed, June 23, 2010 12:18:34 PM > Subject: Re: [phobos] phobos commit, revision 1689 > > Walter tried to enable the restriction at some point but that breaks a ton > of code in Phobos (and probably elsewhere). We discussed adding it as an > compiler flag that I'd turn on, get Phobos to work, and then check in before > dmd makes it mandatory. @property is a prime example countering the > theory that Walter doesn't listen to what's going on on the newsgroup (lazy > is another one.) Unfortunately, design by newsgroup is seldom good, sigh. > Landslide popular vote is not a good measure of quality. Good examples of > proposals coming from the newsgroup have been, I think, most always > originating from strong individual propositions (e.g. Steve's > inout). Andrei On 06/23/2010 11:11 AM, David Simcha > wrote: > When is @property going to start being enforced, i.e. when are > you going > to no longer be able to call non @property functions w/o ()s > or assign > using the = sign to a n...@property function? I never > really followed > the newsgroup discussion b/c I was happy with the old > status quo and > didn't think Walter would give in, so I lost track of > what exactly > @property even does. > > On Wed, Jun 23, 2010 > at 12:07 PM, Andrei Alexandrescu < > href="mailto:[email protected]">[email protected] > <mailto: > ymailto="mailto:[email protected]" > href="mailto:[email protected]">[email protected]>> > wrote: > > On 06/23/2010 10:59 AM, Max Samukha > wrote: > > > > On Wed, Jun > 23, 2010 at 5:45 PM, Andrei Alexandrescu > > < > href="mailto:[email protected]">[email protected] <mailto: > ymailto="mailto:[email protected]" > href="mailto:[email protected]">[email protected]> > > <mailto: > href="mailto:[email protected]">[email protected] <mailto: > ymailto="mailto:[email protected]" > href="mailto:[email protected]">[email protected]>>> > wrote: > > I think it > should be a property. I followed the convention that > > stuff that doesn't change "this" is a > property. > > > Andrei > > > But property setters > are often supposed to change 'this'? > > > Well > of course I was referring to getters. > > > > Honestly I can > hardly see > much utility in @property. For example, Q_PROPERTY in > > Qt adds > value. It is > introspectable, can fire a notification when changed, > > optionally shows up in the designer, is resettable to a > default > value > > and more. Is @property only useful for disambiguating the > case > when a > > function returns a callable? > > > On > the same grounds, I opposed @property tooth and nail and now, > > unpleasantly enough, my worst scares are coming true: @property is > a > non-falsifiable sham, a convention defined for the sake > of following > it. I strongly believe the alternatives I > proposed would have been > vastly > better. > > > Andrei > > > _______________________________________________ > > phobos mailing list > > ymailto="mailto:[email protected]" > href="mailto:[email protected]">[email protected] <mailto: > ymailto="mailto:[email protected]" > href="mailto:[email protected]">[email protected]> > > > http://lists.puremagic.com/mailman/listinfo/phobos > > > > > > _______________________________________________ > phobos mailing > list > > href="mailto:[email protected]">[email protected] > > href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank > >http://lists.puremagic.com/mailman/listinfo/phobos _______________________________________________ phobos > mailing list > href="mailto:[email protected]">[email protected] > href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank > >http://lists.puremagic.com/mailman/listinfo/phobos _______________________________________________ phobos mailing list [email protected] http://lists.puremagic.com/mailman/listinfo/phobos
