From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lawrence Mitchell Newsgroups: gmane.emacs.help Subject: Re: CL compatibility question Date: Thu, 06 May 2004 22:53:39 +0100 Organization: funfunfun Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1083881353 16869 80.91.224.253 (6 May 2004 22:09:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 May 2004 22:09:13 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 07 00:09:06 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BLr3B-000700-00 for ; Fri, 07 May 2004 00:09:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BLqwN-0006fZ-Mm for geh-help-gnu-emacs@m.gmane.org; Thu, 06 May 2004 18:02:03 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-X-Complaints-To: http://news.individual.net/abuse.html Original-X-Trace: news.uni-berlin.de AMwCRoANwIPcfzwdf1dMtA3PrSIFzV+GA+i8kWoVCkkdbUweU= X-No-Yes: No Mail-Copies-To: nobody User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 Cancel-Lock: sha1:fmaPC9RqN6ZwjBNQ5chBuG5P1n4= Original-Xref: shelby.stanford.edu gnu.emacs.help:123039 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:18326 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:18326 Joe Corneli wrote: [...] > 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) This is because &body isn't a recognised lambda list keyword in emacs lisp. If you want to use full CL-style lambda lists in DEFUN and DEFMACRO forms, you should do: (require 'cl) and use the DEFUN* and DEFMACRO* forms (note star). (defmacro* defbashfun (name lambda &body body) `(defun ,name (&rest $@) (apply (lambda ,lambda ,@body) $@))) (defbashfun taco (beef beans) (car $@)) (taco t nil) => t Alternately, define defbashfun as: (defmacro defbashfun (name lambda &rest body) ...) [...] -- Lawrence Mitchell