This project is archived and is in readonly mode.
XML Builder redefines some methods that breaks things
-
Jeremy Kemper
- State changed from new to invalid
This feels strange, but it's expected behavior. Contact your IDE vendor with a bug report if its inspector or debugger can't handle these objects.
-
mt
It can't possibly be valid behavior for an equality operator to cause side effects.
Note that this did not just break the IDE, it broke the application itself.
-
Jeremy Kemper
It can, however, be valid behavior for the absence of an equality operator to confuse and frustrate you ;)
-
mt
How much sense does it make to sacrifice very basic semantics of objects for the ability to generate a <==> tag, something which nobody will ever want to do?
Oh well, I already patched this so our application can run, so I don't care to debate it further, but this bug wasted a good deal of time of me and my coworkers, and I thought I would try to spare others.
-
Jeremy Kemper
I agree it's a strange thing to run into. But it's reasonable and, once you consider the design constraints at play, even desirable.
If you think BlankSlate has minimal semantics, wait until you see BasicObject in Ruby 1.9! Both are intended to remove most of the conveniences of Object, but BasicObject goes even further than BlankSlate. Even things like constant resolution fail.
These 'minimal' objects play an interesting role in Ruby. You'll see the pattern elsewhere with objects whose method calls act as proxies in some way. Looking at this pattern as sacrificing something just to generate some crazy (and invalid) xml tag is missing the larger picture of their design and role in Ruby.
I suggest you continue the discussion on the ruby-talk mailing list :)
-
mt
FWIW, I notice that BasicObject in Ruby 1.9 DOES define == properly. Nyah.