From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "lalit mohan tripathi" Newsgroups: gmane.emacs.help Subject: elisp: how to pass a list argument to defun Date: Wed, 28 Jun 2006 15:06:40 +0530 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0381804409==" X-Trace: sea.gmane.org 1151568518 6788 80.91.229.2 (29 Jun 2006 08:08:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 29 Jun 2006 08:08:38 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 29 10:08:35 2006 Return-path: Envelope-to: geh-help-gnu-emacs@gmane.org Original-Received: from mail-relay.eunet.no ([193.71.71.242]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FvrZi-0000As-Qg for geh-help-gnu-emacs@gmane.org; Thu, 29 Jun 2006 10:08:34 +0200 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by mail-relay.eunet.no (8.13.6/8.13.1/GN) with ESMTP id k5S9e3aD049564 for ; Wed, 28 Jun 2006 11:40:04 +0200 (CEST) (envelope-from help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org) Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FvWTd-0007Kz-Vk for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Jun 2006 05:36:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FvWTS-0007Kj-IN for help-gnu-emacs@gnu.org; Wed, 28 Jun 2006 05:36:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FvWTR-0007KP-UO for help-gnu-emacs@gnu.org; Wed, 28 Jun 2006 05:36:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FvWTR-0007KK-Jz for help-gnu-emacs@gnu.org; Wed, 28 Jun 2006 05:36:41 -0400 Original-Received: from [72.14.204.233] (helo=qb-out-0506.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FvWfj-0000H0-Vc for help-gnu-emacs@gnu.org; Wed, 28 Jun 2006 05:49:24 -0400 Original-Received: by qb-out-0506.google.com with SMTP id q12so232350qba for ; Wed, 28 Jun 2006 02:36:40 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=lchdHpacvB4VqV5Kc1V8u5eY5EbCbvEmZlH2bdZxJKCD2ToyTuZuBU+VpAGCI9do6jAxTW2InS/OMyYA3ALpYpb+K6ch93UEnSpAufxHmUHvKZx8GlPjQayLfZWglvOT0iY6BXmuAUl1LY7IjXrNXk+LNJiLugP3O6glVyhcrJQ= Original-Received: by 10.64.184.4 with SMTP id h4mr977765qbf; Wed, 28 Jun 2006 02:36:40 -0700 (PDT) Original-Received: by 10.64.142.12 with HTTP; Wed, 28 Jun 2006 02:36:40 -0700 (PDT) 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 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,HTML_30_40, HTML_MESSAGE,UNPARSEABLE_RELAY autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on mail-relay.eunet.no Xref: news.gmane.org gmane.emacs.help:35720 Archived-At: --===============0381804409== Content-Type: multipart/alternative; boundary="----=_Part_47200_27327116.1151487400335" ------=_Part_47200_27327116.1151487400335 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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("=C6=08!=1B,HG=1B(B =1B,HH =1B(B!=1B,H\=1B(Bn=1B,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. ------=_Part_47200_27327116.1151487400335 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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("=C6=08!=1B,HG=1B(B =1B,HH    =1B(B!= =1B,H\=1B(Bn=1B,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.
------=_Part_47200_27327116.1151487400335-- --===============0381804409== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ help-gnu-emacs mailing list help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============0381804409==--