On 13-Dec-99, [EMAIL PROTECTED] wrote:
>There is one painful exception that does not fit in this metaphor. That is
>the reported case:
>>> list: [1 2 3 4]
>>> list2: next list
>>> clear list
>>> list2
>== [2 3 4]
>Here list2 should not report [2 3 4]. It should report []. Since the movie
>contains zero frames, list2 should not recall that there were frames at the
>time it was assigned the value: next list. To accomplish that, list2 must
>negotiate its value with the movie when it reports the frames it is
>assigned to. If it only sticks to its own offset into the block that was
>cleared, it apparently finds the old values because they were not
>physically removed.
>List2 becomes painfully aware that the movie was modified when it tries to
>respond to stuff like length?:
>>> length? list2
>** Script Error: Out of range or past end.
>** Where: length? list2
It seems to me the problem is the command "clear". Consider the analogous
sequence in Scheme
: (set! list1 '(1 2 3 4))
#[undefined]
: list1
(1 2 3 4)
: (set! list2 (cdr list1))
#[undefined]
: list2
(2 3 4)
: (set! list1 '())
#[undefined]
: list1
()
: list2
(2 3 4)
: (length list2)
3
Note that in Scheme there is no destructive command "clear", instead list1 has
to be "set!" to the empty list, which is a new empty list and leaves list2
unaffected. Shouldn't "clear" work the same way? i.e. create a new empty list.
Brent Meeker