XML, Squeak, and speed
Michael Rueger
m.rueger at acm.org
Fri May 11 06:38:07 UTC 2001
"Richard A. O'Keefe" wrote:
>
> Michael Rueger <m.rueger at acm.org> provided this code to add to YAX:
...
> descendants: nodeName do: aBlock
> "self name = nodeName
> ifTrue: [^aBlock value: each]."
> self entities do: [:each | each value name = nodeName
> ifTrue: [aBlock value: each]
> ifFalse: [each value descendants: nodeName do: aBlock]]! !
>
> There is a problem with that. Or rather, if you start from a vague
> term like "descendants", you'll get differing interpretations.
> If you have
> <A><B><B><B><C/></B></B></B></A>
> how many B descendants does it have?
>
> By my criterion (and code), it has three.
> According to this code, it has one.
Ahem, sure? Watch out for the code that actually is commented out ;-)
Michael
--
"To improve is to change, to be perfect is to change often."
Winston Churchill
+------------------------------------------------------------+
| Michael Rueger m.rueger at acm.org ++1 (310) 937 7196 |
+------------------------------------------------------------+
More information about the Squeak-dev
mailing list
|