changed the compiler to allow assignment to an argument in a method
This commit is contained in:
@ -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
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include 'Collect.moo'.
|
||||
#include 'Process.moo'.
|
||||
|
||||
(* -------------------------------------------------------------------------- *)
|
||||
|
||||
class FFI(Object)
|
||||
{
|
||||
@ -78,9 +79,7 @@ f isNil ifTrue: [ self error: 'No such function' ].
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#########################################################################################
|
||||
(* -------------------------------------------------------------------------- *)
|
||||
|
||||
#include 'Stdio.moo'.
|
||||
#include 'Console.moo'.
|
||||
|
@ -80,7 +80,6 @@ class MyObject(Object)
|
||||
'duplicate temporary variable name'
|
||||
'duplicate variable name'
|
||||
'duplicate block argument name'
|
||||
'cannot assign to argument'
|
||||
'undeclared variable'
|
||||
'unusable variable in compiled code'
|
||||
'inaccessible variable'
|
||||
|
Reference in New Issue
Block a user