help please

Discussion of Common Lisp
Post Reply
fred

help please

Post by fred » Mon Oct 05, 2009 6:29 am

probably an easy question for most but I'm just a beginner

I basically just want to change the lists in the below function
without using setf or setq
Eg make-array newarray1 newarray2 array3 array4 array5


I'm using an array of lists

Code: Select all

(defparameter *start-state*  (make-array '5 :initial-contents '((10 20 30 40 50)()()()())))

(defun measurement (state)
       (let*  ((array1 (aref state 0))
       (array2 (aref state 1))
       (array3 (aref state 2))
       (array4 (aref state 3))
       (array5 (aref state 4))

       (newarray1 (cdr array1))
       (newarray2 (cons (car  array1)  array2))))

nuntius
Posts: 538
Joined: Sat Aug 09, 2008 10:44 am
Location: Newton, MA

Re: help please

Post by nuntius » Mon Oct 05, 2009 11:03 pm

I don't understand the question.

If I call (measurement *start-state*), what should the return value be and what should *start-state* equal?

Post Reply