beginners "let"/"random" question

Hi!

This being my first post to this list, I apologize if this is inappropiate.

This is a newbie question. My problem is as follows: I am trying to create a

function that takes a list of atoms as input, and returns two strings, which

are parts of the original string split in two at a random location. Example

would be

Quote:

> (split '(0 1 1 0))

((0) (1 1 0))

> (split '(0 1 1 0))

((0 1) (1 0))

I tried using something like

(define (split lst)

(let ((split-point (random (length lst))))

(cons (first-part split-point lst)

( last-part split-point lst))))))

Where (first-part) anda (last-part) are functions that takes a number and a

list as arguments, and returns the elements of the list before and after the

number.

The problem seems to be that the (rand) function is evaluated every time I

refer to (split-point) in the function, so the split-point does not stay

constant through the function.

Any help would be appreciated, as I'm a stuck here.

Martin