Thien-Thi Nguyen <[EMAIL PROTECTED]> writes:
> "William Xu" <[EMAIL PROTECTED]> writes:
>
>> ;; FIXME: Is this the correct way, using `eval'?
>> (eval `(define-wajig-command ,command)))
>> (eval `(define-wajig-command ,command (pkg))))
>
> if it works, it's not incorrect.
Yup. It does work. I've used this package for some time.
> as for style... personally, i would rewrite it as a function, w/
> prefix "wajig-". it's true that a macro may look cleaner in ~/.emacs,
> but then you have to remember that it's a macro, etc. geezers like me
> hate that.
Well, considering there are dozens of wajig commands, most of which
could be defined by a similar definition body, it would be too crazy to
`defun' them one by one...
The problem here is how to map a macro to a list, which i've been
thinking about all the time. Seems i'm forced to use an explicit
`eval'. Things is a bit different in scsh, though. In scsh, i don't
need that explicit `eval', e.g.,
(map (lambda (cmd) (run (,cmd))) '(ls pwd))
This works quite nicely, simply wrapping around a macro(run, here) with
a lambda function.
---
William
_______________________________________________
Gnu-emacs-sources mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources