[Q] Network IM and Jabber
brian at teuton.org
Fri Apr 4 08:46:05 UTC 2003
Quoting Avi Bryant <avi at beta4.com>:
> On Thu, 3 Apr 2003, Brian Brown wrote:
> > openOn: anXMLWriter
> > | elementDTD dtd |
> > self xmlWriter: anXMLWriter.
> > dtd _ self class dtd.
> > elementDTD _ dtd elementDeclaration: self dtdName.
> > anXMLWriter dtd: dtd.
> > elementDTD marshalStart: self on: anXMLWriter.
> > anXMLWriter stream flush
> > It's having a problem with the: dtd _ self class dtd.
> > self is a JabberStream which has no method #class, so is that a (gulp)
> > Or is it a method of Object?
> It is indeed a method of Object. You can find this out using the
> "implementors of" feature: select the word "class" and hit cmd-m. If you
> have "optional buttons" enabled, there should also be an "impl" button in
> your browser that will show you a menu with selectors to choose from.
> Either way, you'll get a list of the implementations of #class - in this
> case, only Object.
> The dirty truth about this particular message is that it never actually
> gets sent - it's one of the handful that are essentially inlined by the
> compiler. But that doesn't (usually) change its semantics.
Okay, thanks for the explanation... that makes sense.
> > I find no class named dtd, no instance vars or
> > class vars, only the local var declared in this method.
> Well, "self class dtd" is a method call, not a reference to a class,
> inst var, or class var. It's sending the #dtd message to the result of
> sending the #class message to self - in other words, get the current
> instance's class and send #dtd to it. Having an instance call a class
> side method like this is a fairly common pattern.
> Again, the most natural step here is to ask for the implementors of #dtd.
> What I found is that it's only implemented by XMLDocument, which is not a
> superclass of JabberStream - not surprising, since we knew from the MNU
> that the method didn't exist. Switching over to the class side of
> JabberStream shows a couple of DTD related methods - maybe the method for
> actually returning a DTD object got lost somehow?
> At any rate, it definitely looks to me like the code is somehow
> incomplete. It also looks like it may be written against a different
> version of YAXO from the current one - for example,
> JabberProtocolEntity>>registerDTDs refers to the DTDDeclaration class,
> which doesn't seem to exist anymore.
Well, I guess it'll be a lot harder than I'd hoped, but it'll be fun and
educational... I've had a lot of experience with Jabber protocols, and helped
implement a very nice python library for it... http://www.runeblade.com
More information about the Squeak-dev