I don’t see how a restricted reference by itself is useful, if you cannot
depend upon the object not being mutated via other references.
Agree; this may help you do local proofs of correctness, and may conceivably
help the JIT (though, its pretty smart about figuring this stuff out on its
own),
> On Nov 29, 2021, at 10:42 AM, Simon Roberts
> wrote:
>
> I will say that as Java provides more and more features modeled on more
> functional languages, I'm finding more and more people struggling with the
> inherently mutable nature of Java, and that I strongly believe that
> something that
t; github.com
>
>
> De: Alberto Otero Rodríguez
> Enviado: jueves, 25 de noviembre de 2021 9:39
> Para: Justin Dekeyser
> Cc: core-libs-dev@openjdk.java.net
> Asunto: RE: Adding an @Immutable annotation to Java
>
> I have not thought about
.
github.com
De: Alberto Otero Rodríguez
Enviado: jueves, 25 de noviembre de 2021 9:39
Para: Justin Dekeyser
Cc: core-libs-dev@openjdk.java.net
Asunto: RE: Adding an @Immutable annotation to Java
I have not thought about that. I'm not a Java expert.
I just throwed the idea precise
If this is really something that's desired, then why use an annotation
when there's a keyword already available: const. However, there's a
reason that's never been actually used in Java, and that's because it's
so hard to get right.
On 26/11/2021 00:11, Alan Snyder wrote:
I like the idea of
I like the idea of an @Immutable annotation. So much so, that I have created
one and use it heavily.
However, my @Immutable is just for documentation; it does not have a rigorous
semantics that would be
needed for a compiler to validate its use or generate different code.
But it could be used by
I would think that if a class is marked immutable that would imply all the
fields in it and from its inherited
classes should be immutable. If fields are marked immutable then it would only
apply to them.
What I wonder is what its relationship to final would be. The final annotation
implies th
On 11/25/21 08:27, Justin Dekeyser wrote:
Quick question, out of curiosity: how would it behave with respect to
inheritance? Can a @Immutable class inherit from an non immutable one?
And: does @Immutable mean deeply immutable? IMO it really should,
but that's harder to check, and we'd have to
Enviado: jueves, 25 de noviembre de 2021 9:27
Para: Alberto Otero Rodríguez
Cc: core-libs-dev@openjdk.java.net
Asunto: Re: Adding an @Immutable annotation to Java
Hello,
Quick question, out of curiosity: how would it behave with respect to
inheritance? Can a @Immutable class inherit from an non im
Hello,
Quick question, out of curiosity: how would it behave with respect to
inheritance? Can a @Immutable class inherit from an non immutable one?
if no: that's a bit annoying, no? (fake immutability)
Can @Immutable class be subclassed to a non @Immutable one? if no:
that's a bit annoying too, no
10 matches
Mail list logo