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

Michal Moskal michal.moskal at gmail.com
Tue Feb 20 13:21:16 CET 2007


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.


-- 
   Michał


More information about the devel-en mailing list