Hi all,

Please consider the following lines of code :

(defmacro-public new-func (f x) `(define (,f) ,x))

(define alist (list (cons "f" 1) (cons "g" 2)))

(define (find-x f) (cdr (assoc f alist)))

(new-func f (find-x "f"))
(new-func g (find-x "g"))

How can I rewrite the macro new-func to factor out find-x in the macro
definition ?

Thanks,
Aurelien


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

Reply via email to