Jump to content

Recommended Posts

Dear All,

  

I'm searching ways of making lists of lists.

I tried all this because I was wanting to call materials from an array, like this:

 

(setf mat1 '(c4 d4 ds7))
(setf mat2 '(d4 e4 c5))
(setf mat3 '(d4 eb4 cs5))
(setf mat4 '(d4 f4 c5))
(setf mat5 '(d4 g4 c5))
(setf mat6 '(d4 a4 c5))
(setf mat7 '(e4 a4 c5))
(setf mat8 '(f4 a4 c5))
(setf mat9 '(g4 a4 c5))
(setf mat10 '(a4 a4 c5))
(setf mat11 '(b4 a4 c5))

(setf array (build-array
'((mat0 mat1 mat2 mat3) (mat4 mat5 mat6 mat7) (mat8 mat9 mat10 mat11))))
;;;GET-ARRAY : (ROW COLUMN SIZE ARRAY &KEY DIRECTION 

(get-array 0 1 2 array :direction 'down)
(setf listmat (get-array 0 1 2 array :direction 'down))
(list listmat) ; this does not work

; the result should be
(list mat1 mat5)
((c4 d4 ds7) (d4 g4 c5))

 

What I did wrong ?

 

Thanks in advance

Link to comment
Share on other sites

(setf mat0 '(c4 d4 cs5))
(setf mat1 '(c4 db4 ds7))
(setf mat2 '(d4 e4 c5))
(setf mat3 '(d4 eb4 cs5))
(setf mat4 '(d4 f4 c5))
(setf mat5 '(d4 g4 c5))
(setf mat6 '(d4 a4 c5))
(setf mat7 '(e4 a4 c5))
(setf mat8 '(f4 a4 c5))
(setf mat9 '(g4 a4 c5))
(setf mat10 '(a4 a4 c5))
(setf mat11 '(b4 a4 c5))

(setf array (build-array
             (list
             (assemble-seq mat0 mat1 mat2 mat3)
             (assemble-seq mat4 mat5 mat6 mat7)
             (assemble-seq mat8 mat9 mat10 mat11))))

(get-array 0 1 2 array :direction 'down)
=> ((c4 db4 ds7) (d4 g4 c5))


In your variables mat0 was missing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy