[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for Dlang support] d: add support for lookahead correction
From: |
Akim Demaille |
Subject: |
Re: [PATCH for Dlang support] d: add support for lookahead correction |
Date: |
Fri, 20 Nov 2020 06:34:57 +0100 |
Hi H.S.,
> Le 18 nov. 2020 à 13:44, H. S. Teoh <hsteoh@quickfur.ath.cx> a écrit :
>
> D unfortunately does not have "logical const".
Yeah, I ventured that. But I'm not sure one can call this "unfortunate".
It might well be one of these nice ideas that end up making things way
more complex.
I like having it in C++, but whether it is truly a blessing, that I don't
know for sure.
> It has "physical const"
> which is mechanically enforced by the compiler. Furthermore, const is
> "infectious" (transitive): once a reference is marked const, everything
> it refers to is also const, as far as can be seen via that reference. A
> const reference can refer to a mutable object, but you cannot modify the
> object through that reference, it can only be mutable through a mutable
> reference.
These are clear, simple, intuitive rules.
Thanks for insight.
Cheers!