On Monday, 17 March 2014 at 14:39:16 UTC, Adam D. Ruppe wrote:
On Monday, 17 March 2014 at 14:31:54 UTC, Spacen Jasset wrote:
Thanks. What devilish magic allows for the syntax 60.days?
(how does it work)
There's a function in core.time:
Duration days(int n);
D functions f(x, t...) can also be called x.f(t) (or x.f
without parameters if there's no additional arguments).
This works on all types, it is called uniform function call
syntax, or UFCS. It lets us extend other things with new
methods.
Thanks Adam, is there a good explanation anywhere? It must be
newish.