syntax sugar: std.path::buildPath instead of from!"std.path".buildPath

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 15 00:59:19 PST 2017


On 2017-02-14 17:25, Andrei Alexandrescu wrote:

> My recollection is past discussions got stalled because the approach is
> combinatorially bankrupt. How would one express the constraints of the
> functions above with simple named constraints? (Not rhetorical; please
> do provide an example if possible.) Before long there is an explosion in
> names ("BidirectionalWithLvalueElementsAndLength", ...).

Forgot to say that I don't think it's unreasonable to have a named 
constraint for each function (regardless if using only existing language 
features or adding something new). That way you can lift out the 
constraint separately from the function declaration. One way to make 
something complex less complex, is to split it up. It's not like you 
would have the complete source code of an application in a single file, 
that would be too much to read in one place (yes, there are other 
reasons to have multiple files). Same idea here.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list