www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Way to use var instead of auto?

reply MMJones <MMJones mail.com> writes:
I like the term var better than auto. Is there a way to alias 
auto?
Jul 03 2016
next sibling parent ag0aep6g <anonymous example.com> writes:
On 07/04/2016 12:00 AM, MMJones wrote:
 I like the term var better than auto. Is there a way to alias auto?
no
Jul 03 2016
prev sibling next sibling parent Jack Stouffer <jack jackstouffer.com> writes:
On Sunday, 3 July 2016 at 22:00:39 UTC, MMJones wrote:
 I like the term var better than auto. Is there a way to alias 
 auto?
If you're thinking of var as in JS's var, they're not the same thing. Even if you could alias it I would advise against doing something like that; assume your code will be maintained by someone else one day.
Jul 03 2016
prev sibling parent ZombineDev <petar.p.kirov gmail.com> writes:
On Sunday, 3 July 2016 at 22:00:39 UTC, MMJones wrote:
 I like the term var better than auto. Is there a way to alias 
 auto?
If you really want to have Javascript-like semantics in D, you try this: https://github.com/adamdruppe/arsd/blob/master/jsvar.d
Jul 04 2016