Sujet : Re: lisp-sound v0.2.1
De : enometh (at) *nospam* meer.net (Madhu)
Groupes : comp.lang.lispDate : 16. Feb 2025, 06:17:51
Autres entêtes
Organisation : Motzarella
Message-ID : <m3frkewjr4.fsf@leonis4.robolove.meer.net>
References : 1 2 3 4 5 6 7
* zara <
m2pljiv7p9.fsf@freecol.be> :
Wrote on Sun, 16 Feb 2025 05:23:30 +0100:
Madhu <enometh@meer.net> writes:
* zara <m2tt8wv3gm.fsf@freecol.be> :
Wrote on Fri, 14 Feb 2025 18:30:33 +0100:
(defun make-dictionary ()
(let ((*dict ()))
>
(defun add (value)
(setq *dict (append *dict (list (length *dict) value))))
>
(defun get-with-index (index)
(let ((*index 0))
(loop for el in *dict
do (if (= (car el) index)
(return (cadr el))
(setq *index (+ 1 *index)))
(return ()))))
>
(defun dispatch (msg)
(cond ((eq msg 'add) #'add)
((eq msg 'get-with-index) #'get-with-index)
(T (print "make-dictionary : Message not understood"))
))
>
#'dispatch))
This is still completely wrong and you havent understood it even after
it has been explained 4 times. You CANNOT use DEFUN here to define
add. You HAVE to use LABLES instead of defun.
try loading wavesample.lisp and run the dictionary test again. do you