Interested in D, spec confuses me.
H. S. Teoh via Digitalmars-d
digitalmars-d at puremagic.com
Tue Feb 2 12:17:20 PST 2016
On Tue, Feb 02, 2016 at 09:13:41PM +0100, anonymous via Digitalmars-d wrote:
[...]
> The other signature is no different. Two occurrences of "immutable",
> applying to two different things.
>
> I agree that it can be unclear to newbies what exactly is immutable
> when a method is marked immutable, but the meaning of the keyword is
> the same as elsewhere. Using another word there would be more
> confusing.
Another way to think about it, is that the "immutable" on the function
means that the implicit `this` reference to the object is immutable.
T
--
"How are you doing?" "Doing what?"
More information about the Digitalmars-d
mailing list