A pattern I'd like to see more of - Parsing template parameter tuples

Sjoerd Nijboer sjoerdnijboer at gmail.com
Tue May 22 22:32:12 UTC 2018


On Tuesday, 22 May 2018 at 14:56:52 UTC, Ethan wrote:
> Repeat ad infinitum for each slightly different configuration 
> you want. I always make the point of programmers being lazy by 
> definition, and not being able to do something as simple as 
> declare a type with a single statement is an clear example of 
> reducing usability - which is a critical consideration the 
> lazier a programmer is.

This is the place where an editor could greatly improve 
productivity.
Writing the parameterized instantiation of `enum option = 
Option(foo: true, bar: 5 ..);` and just being able to press a 
hotkey in a code editor and have the type automagically generated 
for you would nullify this benefit and at thesame time giving you 
all benefits of a struct.
It even allows you to later add in some specific kind of 
initialization of these variables whitout much hastle.

This is something i really miss in D. :/



More information about the Digitalmars-d mailing list