introduced a new class modifier #immutable to indicate that an instantiated object cannot be modified using basicAt:put:

This commit is contained in:
hyunghwan.chung
2017-05-07 05:18:21 +00:00
parent 1dff630fdd
commit 63519c1ca3
8 changed files with 83 additions and 100 deletions

View File

@ -116,7 +116,7 @@ class(#character) String(Array)
## -------------------------------------------------------------------------------
class(#character,#final,#limited) Symbol(String)
class(#character,#final,#limited,#immutable) Symbol(String)
{
method asString
{

View File

@ -291,7 +291,7 @@ class Number(Magnitude)
}
}
class Integer(Number)
class(#limited) Integer(Number)
{
method timesRepeat: aBlock
{
@ -310,17 +310,17 @@ class SmallInteger(Integer)
method(#primitive) asError.
}
class(#liword) LargeInteger(Integer)
class(#liword,#limited) LargeInteger(Integer)
{
}
class(#liword) LargePositiveInteger(LargeInteger)
class(#liword,#immutable) LargePositiveInteger(LargeInteger)
{
method abs { ^self }
method sign { ^1 }
}
class(#liword) LargeNegativeInteger(LargeInteger)
class(#liword,#immutable) LargeNegativeInteger(LargeInteger)
{
method abs { ^self negated }
method sign { ^-1 }