On Mon, 1 Dec 2008 06:53:47 -0800 (PST) ivant <[EMAIL PROTECTED]> wrote:
> > On Dec 1, 9:23 am, "Andrew P. Lentvorski, Jr." <[EMAIL PROTECTED]> > wrote: > > (defmacro with-gl > [gl mode & body] > `(try (. ~gl glBegin (. GL ~mode)) > [EMAIL PROTECTED] > (finally (. ~gl glEnd)))) > > I think it is better, because it uses try/finally to make sure the > gl.glEnd is always called; and the macro name uses the with-* > convention, like with-open, with-meta, etc. > I think it would be better to call it with-gl-begin or with-gl-block, since with-gl sounds more general, and this macro specifically creates a begin/end block. Also, `gl' would be evaluated twice, therefore it should be let onto a gensym, like `(let [gl# ~gl] ...)'. This may not be very important in this macro, since gl would probably be a variable reference, but generally it's an important guideline. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---