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

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

Re: Reverse pop, return value


From: Lennart Borgman
Subject: Re: Reverse pop, return value
Date: Tue, 17 Nov 2009 16:48:31 +0100

On Tue, Nov 17, 2009 at 4:32 PM, LanX <lanx.perl@googlemail.com> wrote:
> Hi
>
> I tried to realize a reverse pop which pops from the end of the list,
> but the code get's "lengthy"....
>
> I need to define a local variable to hold the return value... is there
> a more elegant way to do it?
>
>  ----------- M-x ielm
> ELISP> (defun rpop (LIST)
>         "reverse pop"
>         (let
>            ( (ret (car (last LIST))) )
>            (nbutlast LIST 1)
>            ret
>         )
>       )

prog1




reply via email to

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