The stately := operator feature proposal

MrzlganeE bulletproofchest at gmail.com
Thu May 30 04:41:33 PDT 2013


x := 2 / pi*z;
auto x = 2 / pi*z;

z := column(i, x, diag);
auto z = column(i, x, diag);

I don't think it's worth it force all people to write the second 
form, over a theoretical nitpick that the programmer will 
possibly forget how interpret symbols.

To me, 'auto' has a price. The price is a foreign word being 
inserted into my math. It's an invasive term. It ruins the 
beautiful expression.

If you think the programmer is going to forget how to read 
symbols, you should consider both sides: "The programmer might 
forget how to read symbols, but also the programmer will be able 
to write declarative expressions involving just their own terms."

It's not all bad, you see?

I am trying to reach for an expressiveness which allows such a 
simple thing -- writing expressions that involve just my own 
terms: x. 2. pi. z. That's the feature!

And allowing to make expressions with just my own terms is such a 
small change to the language, we are only inches away from that. 
It drives me crazy to be so close.

auto x = 2 / pi*z; is like ketchup in my sushi, every time.

Try to consider that people always oppose every single new thing. 
They would have said the array slices are not C-like enough, and 
that '..' is not in the C language and should not be used. But we 
have that great feature now because somebody decided not to be so 
conservative.


More information about the Digitalmars-d mailing list