Meaning of the dot-function syntax

dhs dhs at email.com
Sun Oct 1 10:16:50 UTC 2023


On Sunday, 1 October 2023 at 09:24:39 UTC, evilrat wrote:
> On Sunday, 1 October 2023 at 08:22:48 UTC, dhs wrote:
>> Hi,
>>
>> What's the meaning of the dot in the call to writeln() below?
>>
>> ```d
>>     .writeln("Hello there!");
>> ```
>>
>> I haven't found this in the spec or anywhere else. This is 
>> used very often in the source code for Phobos.
>>
>> Thanks,
>> dhs
>
> It is either means "use global scope writeln" in cases when 
> there is local writeln in the scope shadowing global one, or 
> simply a chained calls like myarray.filter().sort().map() each 
> on new line.

Thanks.


More information about the Digitalmars-d-learn mailing list