Hi,
What's the meaning of the dot in the call to writeln() below?
.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
| Thread overview | |||||||
|---|---|---|---|---|---|---|---|
|
October 01, 2023 Meaning of the dot-function syntax | ||||
|---|---|---|---|---|
| ||||
Hi, What's the meaning of the dot in the call to writeln() below?
I haven't found this in the spec or anywhere else. This is used very often in the source code for Phobos. Thanks, | ||||
October 01, 2023 Re: Meaning of the dot-function syntax | ||||
|---|---|---|---|---|
| ||||
Posted in reply to dhs | 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?
I haven't found this in the spec or anywhere else. This is used very often in the source code for Phobos. Thanks, Quote https://dlang.org/spec/module.html#module_scope_operators; >A leading dot (
| |||
October 01, 2023 Re: Meaning of the dot-function syntax | ||||
|---|---|---|---|---|
| ||||
Posted in reply to dhs | 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?
I haven't found this in the spec or anywhere else. This is used very often in the source code for Phobos. Thanks, 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. | |||
October 01, 2023 Re: Meaning of the dot-function syntax | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Anonymouse | On Sunday, 1 October 2023 at 09:20:32 UTC, Anonymouse 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?
I haven't found this in the spec or anywhere else. This is used very often in the source code for Phobos. Thanks, Quote https://dlang.org/spec/module.html#module_scope_operators; >A leading dot (
Oh thank you, especially the link to the spec! | |||
October 01, 2023 Re: Meaning of the dot-function syntax | ||||
|---|---|---|---|---|
| ||||
Posted in reply to evilrat | 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?
I haven't found this in the spec or anywhere else. This is used very often in the source code for Phobos. Thanks, 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. | |||