W3C home > Mailing lists > Public > public-cwm-talk@w3.org > January to March 2007

toward XPathb built-ins for cwm, and some code review

From: Dan Connolly <connolly@w3.org>
Date: Tue, 13 Feb 2007 08:22:46 -0600
To: public-cwm-talk@w3.org, Yosi Scharf <syosi@MIT.EDU>
Message-Id: <1171376566.7497.994.camel@dirk>

Tim, Yosi, and everybody,

I'm trying to use cwm's budding XML support for GRDDL spec work.
I can't get any of the cwm_xml.py built-ins to fire. Are
there any tests for them?

While trying to find the bug...

in term.py, I see...

	if hasattr(self, "evaluate"):
            if (not isinstance(subj, (Literal, CompoundTerm)) or
			not isinstance(obj, (Literal, CompoundTerm))):
                raise ArgumentNotLiteral(subj, obj)
	    return self.evaluate(subj.value(), obj.value())

why not just
   self.evaluate(subj.value(), obj.value())
and catch exceptions?

why default to self in value()? why not raise ArgumentNotLiteral?

    def value(self):
	"As a python value - by default, none exists, use self"
	return self

in query.py, why catch AssertionError!?!?

	if "q" in self.query.mode:
            caughtErrors = (TypeError, ValueError, AttributeError,
AssertionError, ArgumentNotLiteral, UnknownType)

Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E
Received on Tuesday, 13 February 2007 14:22:53 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:01:05 UTC