This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: need SETQ
- To: guile at sourceware dot cygnus dot com
- Subject: Re: need SETQ
- From: Ivan Toshkov <ivant at ifao dot net>
- Date: Fri, 4 Feb 2000 19:21:09 +0200
- References: <m12Gmta-002Uc2C@aliuC2.aliuC2.oas.a2e.de>
On Fri, Feb 04, 2000 at 06:51:50PM +0100, PILCH Hartmut wrote:
> Can anybody post a Standard Scheme Macro that does what SETQ of Common
> Lisp does?
>
> I find it unbelievable that the Scheme designers provide only a set!
> with a useless return value. This language must have been designed by
> academics who scorn the need of programmers.
That's what macros are for.
I think it'll work, though I'm not very experience with macros.
(define-syntax setq
(syntax-rules ()
((setq var value)
(begin
(set! var value)
var))))
--
Ivan Toshkov