Local functions infer attributes?

via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 30 06:20:07 PDT 2014


On Tuesday, 30 September 2014 at 13:08:57 UTC, Wyatt wrote:
> Semi-tangential to this discussion, but this bit hits on 
> something I've been thinking for a little while... ref is, at 
> its core, trying to be a non-nullable pointer.  And I get the 
> strong sense that it's failing at it.

That's a very perceptive observation. :)

So you also get a sense that D could have non-nullable reference 
semantics for a ref-type?

And possibly extend it to be assignable as a 
const-mutable-reference (pointer) using a dedicated operator or 
using the more ugly "&" notation or a cast?

In Simula you had two assignment operators that made the the 
ref/value issue visually distinct.

a :- b;  //a points to b
x := y;  // x is assigned value of y

It is analogue to the "==" vs "is" distinction that many 
languages make. I think it makes sense to have that visual 
distinction. Makes code easier to browse.



More information about the Digitalmars-d mailing list