This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: need SETQ


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]