diff --git a/moo/kernel/Collect.moo b/moo/kernel/Collect.moo index b81bfab..7727981 100644 --- a/moo/kernel/Collect.moo +++ b/moo/kernel/Collect.moo @@ -21,6 +21,15 @@ class Collection(Object) ^count } + method add: object + { + self subclassResponsibility: #add:. + } + + ## =================================================================== + ## ENUMERATION + ## =================================================================== + method do: block { ^self subclassResponsibility: #do @@ -37,13 +46,6 @@ class Collection(Object) ^exception_block value. } -(* ------------------- TODO ------------------------------- - method add: object - { - self subclassResponsibility: #add:. - } -*) - method collect: block { | coll | @@ -924,32 +926,38 @@ class Set(Collection) method do: block { - | bs | + | bs i ass | bs := self.bucket size. - 0 priorTo: bs by: 1 do: [:i | - | ass | + i := 0. + while (i < bs) + { if ((ass := self.bucket at: i) notNil) { block value: ass value }. - ]. + i := i + 1. + }. } - + method keysDo: block { - | bs | + | bs i ass | bs := self.bucket size. - 0 priorTo: bs by: 1 do: [:i | - | ass | + i := 0. + while (i < bs) + { if ((ass := self.bucket at: i) notNil) { block value: ass key }. - ]. + i := i + 1. + }. } method keysAndValuesDo: block { - | bs | + | bs i ass | bs := self.bucket size. - 0 priorTo: bs by: 1 do: [:i | - | ass | + i := 0. + while (i < bs) + { if ((ass := self.bucket at: i) notNil) { block value: ass key value: ass value }. - ]. + i := i + 1. + }. } } diff --git a/moo/kernel/Mill.moo b/moo/kernel/Mill.moo index 908e105..b6b3fbd 100644 --- a/moo/kernel/Mill.moo +++ b/moo/kernel/Mill.moo @@ -95,7 +95,7 @@ class MyObject(Object) (ffi call: #printf signature: 's|iis)i' arguments: #(S'A=>%d B=>%d Hello, world %s\n' 1 2 'fly away')) dump. (ffi call: #printf signature: 's|iis)i' arguments: #(S'A=>%d B=>%d Hello, world %s\n' 1 2 'jump down')) dump. ffi close. - }. + }. (('abcd' == 'abcd') ifTrue: [1] ifFalse: [2]) dump. } @@ -325,7 +325,7 @@ i := 0. while (i < 26) { a putUint8(i, ($A asInteger + i)). - System _putUint8(a, i, ($A asInteger + i)). + System putUint8(a, i, ($A asInteger + i)). i := i + 1. }. while (i > 0) diff --git a/moo/kernel/System.moo b/moo/kernel/System.moo index c31f505..dd85da5 100644 --- a/moo/kernel/System.moo +++ b/moo/kernel/System.moo @@ -110,7 +110,7 @@ class System(Apex) ## ----------------------------------------------------- | s | s := Semaphore new. - self signal: s afterSecs: secs. + s signalAfterSecs: secs. s wait. } @@ -121,7 +121,7 @@ class System(Apex) ## ----------------------------------------------------- | s | s := Semaphore new. - self signal: s afterSecs: secs nanosecs: nanosecs. + s signalAfterSecs: secs nanosecs: nanosecs. s wait. } }