help please

Discussion of Common Lisp

help please

Postby 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))))

Re: help please

Postby 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?
User avatar
Posts: 532
Joined: Sat Aug 09, 2008 10:44 am
Location: Newton, MA

Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 4 guests