Single Assignment & readonly Fields in C#

added by sankarsan
6/27/2010 12:22:37 PM


We have all heard about immutable objects, the objects whose field values cannot be altered throughout it’s lifetime.Immutable objects are simpler to deal with in case concurrent programs where they can be shared between multiple threads.The single assignment variables variables which is once assigned a value cannot be reassigned again.These are inherently immutable in nature.In languages like Haskell,Erlang,F# etc. variables are by default single assignment variables