References to const

Robert Fraser fraserofthenight at gmail.com
Thu Nov 13 00:45:45 PST 2008


Jonathan M Davis wrote:
> Andrei Alexandrescu wrote:
>> http://www.digitalmars.com/d/2.0/phobos/std_typecons.html#Rebindable
>>
>> Andrei
> 
> Thanks for the info.  It would be nice if variable references to constant data were built into the language, but as long as Rebindable works, at least it's possible to have them.
> 
> However, it looks like I'm going to have to install dmd differently if I want to be able to use Rebindable.  I'm using gentoo's official ebuild and it's on version 2.008.  I had thought that that was the most recent version, but apparently not - and it looks like Rebindable has been added since then.  Oh well, I'll get a newer version on my system one way or another.  I'd prefer to be on the most recent version of dmd anyway, so this has pointed out to me that I'm quite a bit behind.
> 
> In any case, thanks for the info.  It'll be quite useful.  And from the look of the page that you linked to, you're one of the folks that implemented it, so thanks for that too.
> 
> - Jonathan M Davis

Many wars were fought at one point about exactly this, and, indeed D 
2.000-2.007 had it built into the language. Then Walter decided it would 
be too confusing for there to be both a head-const ("this thing is 
const") and a tail-const ("whatever this refers to is recursively 
const"). Thus, we ended up with the system we have today.



More information about the Digitalmars-d mailing list