all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* CL compatibility question
@ 2004-05-06 19:36 Joe Corneli
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Corneli @ 2004-05-06 19:36 UTC (permalink / raw)



Frode Vatvedt Fjeld suggested (on comp.lang.lisp, 2004-05-06) the
following approach to building something like Bash's `$@' in LISP:

(defmacro defbashfun (name lambda &body body)
  `(defun ,name (&rest $@)
     (apply (lambda ,lambda ,@body) $@)))

In CLISP, this works great.  

(defbashfun taco (beef beans)
  (car $@))
(taco t nil)
;=> T

In ELISP, not so great.

(defbashfun taco (beef beans)
  (car $@))
(taco t nil)
;=>

Debugger entered--Lisp error: (wrong-number-of-arguments (lambda (name lambda &body body) (\` (defun (\, name) (&rest $@) (apply (lambda (\, lambda) (\,@ body)) $@)))) 3)
  (lambda (name lambda &body body) (\` (defun ... ... ...)))(taco (beef beans) (car $@))
  (defbashfun taco (beef beans) (car $@))
  eval((defbashfun taco (beef beans) (car $@)))
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
* call-interactively(eval-last-sexp)

Why is this?  Are there plans that would change this behavior in the
future?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-05-06 22:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.3786.1083877034.1061.help-gnu-emacs@gnu.org>
2004-05-06 21:53 ` CL compatibility question Lawrence Mitchell
2004-05-06 21:56 ` Stefan Monnier
2004-05-06 22:02 ` Miles Bader
2004-05-06 19:36 Joe Corneli

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.