Make dur a property?
Nick Sabalausky
SeeWebsiteToContactMe at semitwist.com
Thu Jan 24 01:52:57 PST 2013
On Thu, 24 Jan 2013 09:52:38 +0100
Jacob Carlborg <doob at me.com> wrote:
> On 2013-01-24 00:16, Nick Sabalausky wrote:
>
> > 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)".
>
> If you don't have "ago" how would you determine the differences
> compared to the opposite,
now - blah vs. now + blah
> which looks like this in Ruby on Rails:
>
> time = 2.days.from_now
>
> "2" is the duration, "days" is the unit and ago/from_now indicates if
> it's positive or negative.
>
More information about the Digitalmars-d
mailing list