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

vc vc at rsdn.ru
Tue Feb 20 16:19:59 CET 2007


> 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.

Really the C# compiler also often convert variables (initialized by literal)
to const. But it hidden from programmers.




More information about the devel-en mailing list