Replacerest Function Example

Details

Action

Given the lists: value[X] = (A B) and value[Y] = (F G)

(1) (2)

 X Y

 * *

/ \ / \

A * F *

 / \ / \

 B () G ()

Replacerest(X,Y)

has the effect of replacing the Rest of the list X with the list Y. It does this by changing pointers:

(1) ------->(2)

 * | *
/ \ | / \

A * -------> F *

/ \ / \

B () G ()

The second argument to Replacerest must be a list. The call causes the value of X to be (A F G)

 (1)

  *

 / \

A *

  / \

  F *

  / \

  G ()