help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: references in elisp


From: Harold Lee
Subject: Re: Newbie: references in elisp
Date: 23 Jan 2007 16:58:30 -0800
User-agent: G2/1.0

On Jan 23, 9:12 am, Pawel <n...@wp.pl> wrote:
> Hallo group members!
> I want my function return one than one element. I C I do it using references. 
> Is there something like reference in elisp? .. or maybe I should use lists 
> with some additional trick?

I guess you mean returning more than one value? Try
MULTIPLE-VALUE-BIND, taken from Common Lisp:

http://www.lisp.org/HyperSpec/Body/mac_multiple-value-bind.html

Thus you can define a function that returns multiple values:

(defun f () (values 1 2))

And get at the values like this:

(multiple-value-bind (a b)
    (f)
  (format "a is %d and b is %d" a b))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]