News for hackers. Stuff that matters.
Re:JavaScript: The World's Most Misunderstood Programming La... by jrockway on Sunday January 04, 2009 @07:05AM (#419206)
cxml-stp is http://www.lichteblau.com/cxml-stp/.

Basically, it's the W3C DOM, but Lisp-like. As an example, CL has a function called "find-if". It visits every element in a sequence, and returns a new sequence containing the elements that match the supplied predicate function. (Think "grep" in Perl.) The DOM doesn't have anything like this, but STP does -- find-child-if and find-recursively-if. That means you can write something expressive like (find-recursively-if (of-name "p") document) to get all the <p> nodes in the document, rather than writing the traversal code manually.

I have used DOM in a variety of languages, and it only feels natural in Java. No other language is crippled the way Java is, so it doesn't make much sense to use the W3C standard, unless you just want to port existing DOM code form one language to another. (Standards are good for legacy code, but not so good for new code.)

There are no comments on this comment yet.