Make dur a property?

Jacob Carlborg doob at me.com
Thu Jan 24 00:52:38 PST 2013


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, 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.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list