Stepping back and looking at constness from another angle.

Leandro Lucarella llucax at gmail.com
Fri Jun 8 09:06:35 PDT 2007


Walter Bright, el  7 de junio a las 13:18 me escribiste:
> Leandro Lucarella wrote:
> >Carlos Santander, el  5 de junio a las 21:15 me escribiste:
> >>invariant(char)[new] ret = "prefix";
> >Syntax is getting so obscure... I'm scared.
> 
> Think of invariant(type) this way: imagine a template that creates a pointer to its type argument:

I _understand_ the syntax, but it's getting really hard to read the code
(and D used to be a very clean language to read, not like C++). I
undestand C++ syntax too, but I think it's way to far from the ideal ;)

I can't think of a better syntax though, but I just had to say it, I'm a
little concerned of how much readabilty D could loose with this.

I think const/invariant/scope are generally good. It's a great tool for
autodocumentation, for compiler optimization and for compile-time check of
bugs. But the thread about steping back got me thinking...

-- 
LUCA - Leandro Lucarella - Usando Debian GNU/Linux Sid - GNU Generation
------------------------------------------------------------------------
E-Mail / JID:     luca at lugmen.org.ar
GPG Fingerprint:  D9E1 4545 0F4B 7928 E82C  375D 4B02 0FE0 B08B 4FB2 
GPG Key:          gpg --keyserver pks.lugmen.org.ar --recv-keys B08B4FB2
------------------------------------------------------------------------
Yo soy Peperino él que nunca toma vino, yo soy aquel que por la mañana
escucha Salatino.
	-- Peperino Pómoro



More information about the Digitalmars-d mailing list