Subject: [clisp-list] array-help

From: "Justice, Randy -CONT" <[email-masked]>
Date: Tue, 20 Feb 2001 15:03:17 -0600

Hi.

Can some explain?

I have an 2D array. I pass the array to a function. 

It function changes the array that is passed to the function.

It looks like a array is passed as a reference not a values.

Is their a method to pass arrays as values? 

See code example... (if needed) Sorry to ask such a simple question. 
I don't have access to newsgroups.

(defun testone (tt value)
  (let* ((ltt tt )
       )
  
  (print 'ltt)
  (print ltt)
  (print 'tt)
  (print tt)

  (setf (aref ltt 0 0) value)
  (print ltt)
  (print tt)
  (print txy)
  nil
  )
)

4. Break [28]> txy
#2A((14 1 8) (2 7 1) (5 2 4))
4. Break [28]> (testone txy 1 )

LTT
#2A((14 1 8) (2 7 1) (5 2 4))
TT
#2A((14 1 8) (2 7 1) (5 2 4))
#2A((1 1 8) (2 7 1) (5 2 4))
#2A((1 1 8) (2 7 1) (5 2 4))
#2A((1 1 8) (2 7 1) (5 2 4))
NIL

---

From: Sam Steingold <[email-masked]>
Date: 20 Feb 2001 17:58:58 -0500

> * In message <[email-masked]>
> * On the subject of "[clisp-list] array-help"
> * Sent on Tue, 20 Feb 2001 15:03:17 -0600
> * Honorable "Justice, Randy -CONT" <[email-masked]> writes:
>

nope, you will have to explicitly copy the array.

-- 
Sam Steingold (http://www.podval.org/~sds)
Support Israel's right to defend herself! <http://www.i-charity.com/go/israel>
Read what the Arab leaders say to their people on <http://www.memri.org/>
There are 3 kinds of people: those who can count and those who cannot.