Watch out though, each item in chickenfarm
is the same chicken object:

> >> chicken: make object! [
> [    tasty: "wings"
> [    ]
> >> chickenfarm: array/initial 10 chicken
> == [
>     make object! [
>         tasty: "wings"
>     ]
>     make object! [
>         tasty: "wings"
>     ]
>     make object! [
>         t...

> Andrew J Martin

Try this:

chickenfarm/1/tasty: "drumsticks" ; change first object in the block
chickenfarm
== [
    make object! [
        tasty: "drumsticks"
    ]
    make object! [
        tasty: "drumsticks"
    ]
    make object! [...

Oh no! They have all changed because they are in fact,
all the same.

        same? chickenfarm/1 chickenfarm/2
        ;== true

I recommend doing this instead:

        chickenfarm: copy [] ; make a new block
        loop 10 [append chickenfarm make chicken []]

Now they are all cloned from the original chicken.

Anton.

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to