Your statement b: c: [] causes b and c to be associated with the same block
so appending to b is the same as appending to c. If you want b and c to be
independent, use
b: copy [] c: copy []
(I haven't tested this, but it's the way I remember other discussions like
this.)
Russell [EMAIL PROTECTED]
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 20, 2000 10:30 PM
Subject: [REBOL] Foreach function
> Hi,all,
> try following:
> a: [ 1 2 3 4
> 5 6 7 8
> ]
> b: c: copy []
> foreach [d f] a [append b d append c f]
> print b
>
> result: 1 2 3 4 5 6 7 8
> not 1 3 5 7
>
> see also:
> a: [ 1 2 3 4
> 5 6 7 8
> ]
> b: c: copy []
> foreach [d f] a [append b d append c f print d]
> result: 1
> 3
> 5
> 7
> what happend?
> bug? or I missed something?
>
> Need help
> Regards
>
> --gerry
>
>