From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kalle Olavi Niemitalo To: Keisuke Nishida Cc: guile-emacs@sourceware.cygnus.com Subject: Re: special forms (save-excursion) Date: Wed, 15 Mar 2000 11:30:00 -0000 Message-id: <874sa8azw4.fsf@PC486.Niemitalo.LAN> References: <87n1o1p9kt.fsf@PC486.Niemitalo.LAN> X-SW-Source: 2000-q1/msg00015.html Keisuke Nishida writes: > Kalle Olavi Niemitalo writes: > > > Should I use defmacro instead of syntax-rules? I like > > syntax-rules more, but it seems slower. > > I think faster one is better. This is not a complex syntax and > easy to maintain. But the macros made with define-macro (what is the difference between that and defmacro?) are not hygienic by default. Should we hygienize each of them separately, or do we just give people a list of symbols which they must not rebind when using the macros? > (define-public (lisp-false? sexp) (or (eq? sexp ()) (eq? sexp nil))) R5RS doesn't say what () evaluates to, so it would be better to quote it. I believe "sexp" means the usual printed form of an expression. The parameter of lisp-false? is the object itself, not a printed form. Use "obj" instead. > (define-public (lisp-variable-set! symbol value) > (lisp-eval `(setq ,symbol ,value))) The value should be quoted in the setq call. (define-public (lisp-variable-set! symbol value) (lisp-eval `(setq ,symbol ',value))) > (define-macro (import-lisp-variable-1 variable . rest) > (let ((name (if (pair? rest) (car rest) variable))) > `(define ,name (make-procedure-with-setter > (lambda () (lisp-variable-ref ',variable)) > (lambda (value) (lisp-variable-set! ',variable value)))))) > (define-public import-lisp-variable import-lisp-variable-1) Can't you just (export import-lisp-variable-1)?