changed the compiler to allow assignment to an argument in a method

This commit is contained in:
hyunghwan.chung
2017-01-09 13:20:46 +00:00
parent 7460ce819c
commit 2528dcdbe5
6 changed files with 39 additions and 36 deletions

View File

@ -123,11 +123,22 @@ class(#byte) ByteArray(Collection)
class Set(Collection)
{
dcl tally bucket.
method new: size
{
^self new initialize: size.
}
method initialize
{
^self initialize: 128. (* TODO: default initial size *)
}
method initialize: size
{
(size <= 0) ifTrue: [size := 2].
self.tally := 0.
self.bucket := Array new: 128. (* TODO: initial size *)
self.bucket := Array new: size.
}
method size