Re: Reasons to choose CLISP over other free implementations
- From: Nicolas Neuss <lastname@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Nov 2007 10:49:04 +0100
Pascal Costanza <pc@xxxxxxxxx> writes:
Nicolas Neuss wrote:
(?2 is a macro choosing the second argument, LRET returns the last
local variable)
Hm, these look like very useful macros to me! Nice.
Pascal
Thanks:-)
Since we have so many newbies, here is the complete code:
(defmacro ?1 (&rest args)
"A macro extracting the first of its arguments."
(first args))
(defmacro ?2 (&rest args)
"A macro extracting the second of its arguments."
(second args))
(defmacro ?3 (&rest args)
"A macro extracting the third of its arguments."
(third args))
(defmacro lret (bindings &body body)
"A @macro{let}-construct which returns its last binding."
`(let
,bindings ,@body
,(let ((x (car (last bindings))))
(if (atom x)
x
(car x)))))
(defmacro lret* (bindings &body body)
"A @macro{let*}-construct which returns its last binding."
`(let*
,bindings ,@body
,(let ((x (car (last bindings))))
(if (atom x)
x
(car x)))))
Nicolas
.
- References:
- Reasons to choose CLISP over other free implementations
- From: Javier
- Re: Reasons to choose CLISP over other free implementations
- From: Geoff Wozniak
- Re: Reasons to choose CLISP over other free implementations
- From: Javier
- Re: Reasons to choose CLISP over other free implementations
- From: Juho Snellman
- Re: Reasons to choose CLISP over other free implementations
- From: Javier
- Re: Reasons to choose CLISP over other free implementations
- From: Juho Snellman
- Re: Reasons to choose CLISP over other free implementations
- From: Nicolas Neuss
- Re: Reasons to choose CLISP over other free implementations
- From: Pascal Costanza
- Reasons to choose CLISP over other free implementations
- Prev by Date: Re: A simple debugging macro
- Next by Date: printing circular data structures
- Previous by thread: Re: Reasons to choose CLISP over other free implementations
- Next by thread: Re: Reasons to choose CLISP over other free implementations
- Index(es):
Relevant Pages
|