Make dur a property?
Nick Sabalausky
SeeWebsiteToContactMe at semitwist.com
Wed Jan 23 15:16:13 PST 2013
On Wed, 23 Jan 2013 21:54:54 +0100
Jacob Carlborg <doob at me.com> wrote:
> On 2013-01-23 21:46, Jonathan M Davis wrote:
>
> > I confess that it's syntax like that that makes dislike UFCS. I can
> > see why you might like it, but personally, I find it to be hideous.
> >
> > But as long as you're not using -property, you can do 2.days to get
> > a Duration of 2 days, much as I wish that you couldn't.
>
> The point is that the code should read like regular text. But if you
> do:
>
> auto t = ago(days(2));
>
> It's backwards[...]
I'll certainly grant that, insofar as the written order is backwards
from the execution order. I think the "ago" is that part that bugs me
the most. It's too clever. I could live with "2.days", but I'd prefer
"days(2)" since that looks like a type constructor, and "days" isn't a
property of 2. Maybe "2.toDays()", but at that point I'd still rather
just do the simpler "days(2)".
More information about the Digitalmars-d
mailing list