[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: elisp: how to pass a list argument to defun
From: |
Pascal Bourguignon |
Subject: |
Re: elisp: how to pass a list argument to defun |
Date: |
Wed, 28 Jun 2006 15:55:21 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
"lalit mohan tripathi" <lalit.tripathi@gmail.com> writes:
> 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)
(defun process-list-fn (list02, a, b, c)
"This function prints the list02, a, b, c."
(print list02,)
(print a,)
(print b,)
(print c))
(process-list-fn 'list01 10 20 30)
prints:
list01
10
20
30
returns:
30
--
__Pascal Bourguignon__ http://www.informatimago.com/
CAUTION: The mass of this product contains the energy equivalent of
85 million tons of TNT per net ounce of weight.