[CM] replacement for def-clm-struct?
Anders Vinjar
andersvi@extern.uio.no
Wed, 22 Sep 2004 17:14:12 +0200
What would be a wise way to define data-structures accessible in
run now that def-clm-struct is gone?
Im looking at dlocsig.lisp for clm-3. It functions allright
(putting in 4th argument *output* to some calls on #'out-any),
however the need to carry all the previous struct-fields as
variables or some such is quite messy and errorprone.
Ive tried replacing make-dlocs with a macro which places the
various fields in an array, making them accessible by straight
array-referencing in run. For some reason i cant get it to work,
getting loads of errors when compiling.
(defmacro make-dlocs (&key start end out-channels rev-channels
out-delays out-map gains rev-gains delay path rev)
;; 11 fields to keep with the generator
`(let ((dl-arr (make-array 11)))
(setf (aref dl-arr 0) ,start)
(setf (aref dl-arr 1) ,end)
(setf (aref dl-arr 2) ,out-channels)
....
and then defining "accessors" along the lines of:
(defmacro dlocs-start (dloc) `(aref ,dloc 0))
(defmacro dlocs-end (dloc) `(aref ,dloc 1))
(defmacro dlocs-out-channels (dloc) `(aref ,dloc 2))
(defmacro dlocs-rev-channels (dloc) `(aref ,dloc 3))
Suggestions?