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: Syntatic sugar and identifier permissivity


Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:

> Thanks to the modified set!, such an inc! macro should be easy to write.

Very easy indeed:

(defmacro inc! (place . val)
 `(set! ,place (+ ,place ,(if (null? val) 1 (car val)))))

(defmacro dec! (place . val)
 `(set! ,place (- ,place ,(if (null? val) 1 (car val)))))

(see incf/decf in CL)

	Ole


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