From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Le Wang" Newsgroups: gmane.emacs.help Subject: Re: elisp: how to pass a list argument to defun Date: 28 Jun 2006 13:59:37 -0700 Organization: http://groups.google.com Message-ID: <1151528377.142358.184110@p79g2000cwp.googlegroups.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1151530866 9170 80.91.229.2 (28 Jun 2006 21:41:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Jun 2006 21:41:06 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 28 23:41:04 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FvhmN-0004Ti-7F for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Jun 2006 23:40:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FvhmM-0006pn-NQ for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Jun 2006 17:40:58 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!p79g2000cwp.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Original-NNTP-Posting-Host: 131.107.0.102 Original-X-Trace: posting.google.com 1151528380 21638 127.0.0.1 (28 Jun 2006 20:59:40 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 28 Jun 2006 20:59:40 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; WOW64; SV1; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 RED-PRXY-26 Complaints-To: groups-abuse@google.com Injection-Info: p79g2000cwp.googlegroups.com; posting-host=131.107.0.102; posting-account=j4OimgwAAAALo-2szSZvOyX5OE1uyIeS Original-Xref: shelby.stanford.edu gnu.emacs.help:140092 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35716 Archived-At: lalit mohan tripathi wrote: > Hi All, > > Could anyone tell me how to pass a list argument in elisp to a defun? > > I'm want to write a defun like this > > (defun process-list-fn (list02, a, b, c) > "This function prints the list02, a, b, c." > (print list02) > (print a) > (print b) > (print c)) > > > I want to use it like this: > > (setq list01 '("abc" "def" "xyz")) > (process-list-fn list01 10 20 30) > > But I get the following error: > > Debugger entered--Lisp error: (void-variable list02) > (print list02) > process-list-fn(("abc" "def" "xyz") 10 20 30) > eval((process-list-fn list01 10 20 30)) > eval-last-sexp-1(nil) > eval-last-sexp(nil) > call-interactively(eval-last-sexp) > recursive-edit() > byte-code("?!?HG ?HH !?H\n?C? > > P.S. I'm able to pass the list to a function but that works when the defun > is defined with only one listarguement. remove the commas from your defun formal parameters list. -- Le