On 30/03/2012 23:31, Marvin Humphrey wrote:
Greets,

This was a little hard for me to figure out what Nick's modification did,
which speaks more to the clarity of the original code than Nick's mod.

The problem is the loop logic:

   FOR class IN classes
     FOR method IN class.methods
       IF method.novel OR (class.parent&&  class.parent.included)
         FOR descendant IN class.descendants
            generate_binding(method)

I presumed there was a reason for walking through the methods in this way.

This loop construct would make more sense.

   FOR class IN classes
     FOR method IN class.methods
       IF class.method_needs_binding(method)
         generate_binding(method)

I'm trying to remember why the code doesn't do that already... I think it
was tricky to figure out whether a method needed to be bound.

Yes, this would be easier. If there's no technical reason against it, let's do it like that.

Nick

Reply via email to