const(FAQ)

Leandro Lucarella llucax at gmail.com
Fri Mar 28 21:57:53 PDT 2008


Walter Bright, el 28 de marzo a las 15:33 me escribiste:
> The same questions about const come up repeatedly, so I decided that it was past time to put up a FAQ dedicated to const. The initial version is far from 
> complete, but it's a start.
> 
> http://www.digitalmars.com/d/2.0/const-faq.html

About "Why aren't function parameters const by default?":

Why aren't *all* variables const by default?

It was discussed a long time ago and AFAIK most people liked it.


And about "Why not use readonly to mean read only view?":

Why not use view to mean read only view?

As discussed recently? I don't think "because it's not that clear that
'view' means 'read only view'" is a good enough reason for changing the
const meaning to make it mean 'read only view'. If words are arbitrary, at
least this scheme let you keep the old const meaning...


-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
Breathe, breathe in the air.
Don't be afraid to care.
Leave but don't leave me.
Look around and choose your own ground.



More information about the Digitalmars-d mailing list