[bitc-dev] on mutable types
Swaroop Sridhar
swaroop.sridhar at gmail.com
Sat May 20 01:26:05 EDT 2006
Sam Mason wrote:
> It's probably a bit late for this, but I'm a bit confused by the "mutable"
> keyword. It appears to do two things, firstly it allows the contents
> of a variable to be changed at runtime. Secondly, in providing this
> mutability an extra level of indirection is introduced -- it is this that
> surprises me.
No extra level of indirection is introduced. The mutable keyword
qualifies the type of an expression, allowing it to be mutated. There is
no `mutable' value constructor.
ex:
(define x:(mutable int32) 10)
(define y:int32 10)
Both x and y have the same representation. x is mutable, y is immutable.
Swaroop.
More information about the bitc-dev
mailing list