[nem-en] Const vs. Static non-mutable

Ivan A Eryshov ivan.eryshov at gmail.com
Tue Feb 20 13:29:45 CET 2007


So, ncc just replaces usages of immutable static fields with literal?
It isn't quite good.

On 20/02/07, Michal Moskal <michal.moskal at gmail.com> wrote:
> On 2/20/07, Vladimir Reshetnikov <v.reshetnikov at gmail.com> wrote:
> > On 2/20/07, Ivan A Eryshov <ivan.eryshov at gmail.com> wrote:
> > > I think the same difference like between const and static readonly in C#.
> >
> > I did not found any 'const' keyword in Nemerle...
>
> In C# 'const' means a value needs to be known at compile time. Then
> the field is saved as a literal, and when it is referenced, also the
> literal value is used.
>
> In Nemerle when you have an immutable field value of which is known at
> compile time, the compiler makes it a literal, but you have no way of
> forcing it.



More information about the devel-en mailing list