Postfix type notation - readability and parsing?

Simen Kjærås simen.kjaras at gmail.com
Wed Mar 6 17:34:34 UTC 2019


On Wednesday, 6 March 2019 at 17:27:55 UTC, Paul Backus wrote:
> On Wednesday, 6 March 2019 at 07:53:42 UTC, Simen Kjærås wrote:
>> Just to add a 6) to the mix:
>>
>> alias port = Option!(immutable ushort, "p|port", "Sets the 
>> port used for serving.", "PORT", 8888);
>>
>> static this() {
>>     port = 1234;
>> }
>
> Option!(...) is a type, not a value, so this should actually be 
> written as:
>
> alias PortOption = Option!(...);
> PortOption port;
>
> static this() {
>     port = 1234;
> }

Not if you use the code in my post, which included a definition 
of Option to support exactly the code I wrote.

--
   Simen


More information about the Digitalmars-d mailing list