diff --git a/stix/kernel/Collection-Array.st b/stix/kernel/Collection-Array.st index a7cc988..f408101 100644 --- a/stix/kernel/Collection-Array.st +++ b/stix/kernel/Collection-Array.st @@ -29,6 +29,11 @@ { 1 to: self size do: [:i | aBlock value: (self at: i)]. } + + #method copy: anArray + { + 1 to: (anArray size) do: [:i | self at: i put: (anArray at: i) ]. + } } #class(#character) String(Array) diff --git a/stix/kernel/Context.st b/stix/kernel/Context.st index f48ef20..58a261c 100644 --- a/stix/kernel/Context.st +++ b/stix/kernel/Context.st @@ -111,17 +111,17 @@ ## less block context before whileTrue: is recursively sent. ## whileTrue: is sent in a method context. -## (self value) ifFalse: [^nil]. -## aBlock value. -## self whileTrue: aBlock. + (self value) ifFalse: [^nil]. + aBlock value. + self whileTrue: aBlock. ## ---------------------------------------------------------------------------- ## ---------------------------------------------------------------------------- - | pc sp xsp | +" | pc sp xsp | sp := thisContext sp. - sp := sp - 1. "decrement sp by 1 becuase thisContext pushed above affects the sp method" + sp := sp - 1. ## decrement sp by 1 becuase thisContext pushed above affects the sp method pc := thisContext pc. self value ifFalse: [ ^nil "^self" ]. aBlock value. @@ -131,7 +131,7 @@ ## this +2 or - 3 above is dependent on the byte code instruction size used for 'store' ## +2 to skip STORE_INTO_TEMP(pc) and POP_STACKTOP. ## TODO: make it independent of the byte code size - +" ## ---------------------------------------------------------------------------- ## #