On Tue, Feb 17, 2009 at 5:33 PM, Stephen C. Gilardi <squee...@mac.com> wrote: > > Turning on nil punning debugging with: > > cd clojure > ant -Dclojure.assert-if-lazy-seq=true > > and testing with: > > user=> (compile 'clojure.contrib.repl-ln) > > suggests that genclass.clj could use some lazy love.
I think this I have just the lazy love it needs... --Chouser --~--~---------~--~----~------------~-------~--~----~ 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
commit 68173e96e709707810c989669a0326a97259f8fe Author: Chouser <chou...@n01se.net> Date: Tue Feb 17 20:50:08 2009 -0500 lazy valentine for genclass diff --git a/trunk/src/clj/clojure/genclass.clj b/trunk/src/clj/clojure/genclass.clj index b7bb74f..43c076c 100644 --- a/trunk/src/clj/clojure/genclass.clj +++ b/trunk/src/clj/clojure/genclass.clj @@ -24,9 +24,9 @@ (let [[mm considered] (loop [mm mm considered considered - meths (concat - (seq (. c (getDeclaredMethods))) - (seq (. c (getMethods))))] + meths (seq (concat + (seq (. c (getDeclaredMethods))) + (seq (. c (getMethods)))))] (if meths (let [#^java.lang.reflect.Method meth (first meths) mods (. meth (getModifiers)) @@ -215,8 +215,8 @@ ;start class definition (. cv (visit (. Opcodes V1_5) (+ (. Opcodes ACC_PUBLIC) (. Opcodes ACC_SUPER)) cname nil (iname super) - (when interfaces - (into-array (map iname interfaces))))) + (when-let [ifc (seq interfaces)] + (into-array (map iname ifc))))) ;static fields for vars (doseq [v var-fields]