aliasing expressions and identifiers

deed via Digitalmars-d digitalmars-d at puremagic.com
Mon May 23 07:05:43 PDT 2016


As I've been finding myself constantly desiring to alias 
expressions and identifiers for many years, I'd like to ask again 
whether it would be possible to extend either the alias-statement 
or the with-statement. It would be great to relieve the constant 
tension between descriptiveness, (often outside your control), 
and brevity in a straightforward manner.

There is something missing when your fields and parameters start 
out with proper names but end up as cryptic abbreviations when 
you start using them. Sometimes you want to look at an identifier 
and understand its purpose, other times you want to look at a 
bunch of expressions and statements and understand their pattern. 
I think an expressive language should support both needs without 
tension. It would also isolate names and reduce editing when 
names change.

Some thoughts about extending the with-statement were brought up 
here earlier:
http://forum.dlang.org/post/txpifmwpmmhsvcpbcijw@forum.dlang.org
I don't care much whether it would be with, alias or possibly 
something clever already existing, but a solution should be easy 
to use, easy to read and shouldn't introduce any possible 
overhead at runtime.

1) Are there any technical blockers for extending the alias- or 
with-statement?
2) Does it carry its own weight?





More information about the Digitalmars-d mailing list