SysTime.add!"days" missing

Ary Borenszweig ary at esperanto.org.ar
Mon Mar 17 08:24:21 PDT 2014


On 3/17/14, 12:11 PM, Spacen Jasset wrote:
> 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.

http://dlang.org/function.html#pseudo-member


More information about the Digitalmars-d-learn mailing list