From: Eric B. <er...@go...> - 2008-11-03 09:43:25
|
Colin Paul Adams wrote: >>>>>> "Eric" == Eric Bezault <er...@go...> writes: > > Eric> Colin Paul Adams wrote: > >> Some other the other reported problems appear to be due to the > >> poor conformance rule for agents. > > Eric> Yes, this has been designed that way to punish people who > Eric> want to overuse agents ;-) > > So it's Franck's fault then, for persuading me to replace loops with > iterators. > > >> so there is no error (`append_node' will receive an argument > >> that conforms to XM_XPATH_NODE). Therefore I need to supress > >> these messages. Is that possible? > > Eric> Yes, you can find the solution in Karine's slides from last > Eric> week. Try to use: > > Eric> agent append_node ({XM_XPATH_TREE_NODE} ?) > > That won't work - some nodes will be XM_XPATH_TINY_NODEs instead. Ah, I see. I think that I already raised this issue at ECMA last year. Not being a big fan of "use agent everywhere" I didn't push any further. In my opinion there are many issues with agents that make me prefer use "regular" feature calls (and hence loops). There is this typing issue. Then there are the inline agents that are too verbose and go against reuse. But without inline agents, agents are not expressive enough to my taste. And the use of agents does not go very well with DbC. Furthermore ISE's storable does not handle them correctly. So, I'm fine using agents in very specific situations. But not everywhere. For your particular problem, perhaps you can add an extra iterator routine in XM_XPATH_AXIS_ITERATOR, something like `do_all_nodes' which takes a PROCEDURE [ANY, TUPLE [XM_XPATH_NODE]] as argument. -- Eric Bezault mailto:er...@go... http://www.gobosoft.com |