diff --git a/moo/kernel/Collect.moo b/moo/kernel/Collect.moo index cf7c1ad..885312f 100644 --- a/moo/kernel/Collect.moo +++ b/moo/kernel/Collect.moo @@ -110,8 +110,6 @@ class(#pointer) Array(SequenceableCollection) ^self at: (self size - 1). } - - method copy: anArray { 0 priorTo: (anArray size) do: [:i | self at: i put: (anArray at: i) ]. @@ -160,6 +158,11 @@ class(#pointer) Array(SequenceableCollection) ^(self class new: newsz) copy: self from: start to: end } + method copyFrom: start count: count + { + ^(self class new: count) copy: self from: start to: (start + count - 1) + } + method replaceFrom: start to: stop with: replacement { ^self replaceFrom: start to: stop with: replacement startingAt: 0. diff --git a/moo/lib/comp.c b/moo/lib/comp.c index f39a283..dd0e83b 100644 --- a/moo/lib/comp.c +++ b/moo/lib/comp.c @@ -5543,7 +5543,16 @@ start_over: * identifer if it encounters an assignment operator after an identifer. * i only allow a basic expression after a logical operator. * the basic expression doesn't include an assignment expression - * if it is not in the parenthesis. so i nullify the following 2 variables */ + * if it is not in the parenthesis. so i nullify the following 2 variables + * + * a := 30 > 20 and 10 > 20 is equavelent to a := (30 > 20 and 10 > 20). + * + * you will encounter a syntax error for the following expression as the + * expression end after y. + * a := 30 > 20 and y := 10 > 20 + * + * a := 30 > 20 and (y := 10 > 20) is perfectly valid. + */ ident = MOO_NULL; ident_loc = MOO_NULL; goto start_over;