[nem-en] Const vs. Static non-mutable
Kamil Skalski
kamil.skalski at gmail.com
Tue Feb 20 20:58:48 CET 2007
I think it would be used only in projects, which require partial
deployment strategies. In such projects probably ALL fields should be
non-const...
2007/2/20, NoiseEHC <NoiseEHC at freemail.hu>:
> The problem with "volatile" is that it is tied to memory barriers and
> the like.
> What you are trying to implement (as I see) is some syntax for
> suppressing the automatic const-ization of fields. So I thought that
> "field" would mean that it is a field and not some literal value. Better
> option is "[NotLiteral]".
> BTW I do not know how many times do you want to use it. In C# I use
> "static readonly" only if "const" cannot be used because of tricky
> initialization expression.
>
> Kamil Skalski wrote:
> > "field"? how it would be used?
> >
> > I think volatile is not that bad - it means: this is immutable field,
> > but it can change at any moment because of "external considerations".
> > As in standard flow, volatile would be a low-level hint for compiler
> > not to assume that field can be pre-fetched.
> >
> > 2007/2/20, NoiseEHC <NoiseEHC at freemail.hu>:
> >> What if we would just define a "field" keyword? Or better an "immutable"
> >> keyword?
> >> Using volatile is clearly confusing.
> >>
> >>
> >>
> >> _______________________________________________
> >> https://nemerle.org/mailman/listinfo/devel-en
> >>
> >
> >
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list