This is the mail archive of the guile@sources.redhat.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]

a happy user


I just wanted to say "Thank you!" to the guile
developers for optargs and generalized set! --
I have been slowly moving a large Common Lisp
program (with antecedents in MacLisp, not to
mention Fortran, SAIL, FAIL...) into Scheme
(Guile), and its main user-interface is a CL
macro essentially defined:

(defmacro with-sound ((&key (srate 22050) ...) &body body)
  (let (...) ,.body))

so that a call looks like

   (with-sound (:srate 44100) (fm-violin 0 1 440 .1))

and in Guile I got it to work as:

(defmacro with-sound (args . body)
  `((lambda* (#:key (srate 22050)
		    (explode #f))
      (let ((old-srate (mus-srate)))
	(dynamic-wind
	 (lambda ()
	   (set! (mus-srate) srate))
	 (lambda ()
	   ,@body)
	 (lambda ()
	   (set! (mus-srate) old-srate)))))
    ,@args))

I'm all smiles!

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user

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