2008-12-07

Plexippus XPath released

The first version of Ivan Shvedunov's Plexippus XPath has been released, an implementation of XPath 1.0, written entirely in Common Lisp.

Plexippus has been available from darcs for a few months now, and we have had some early users (thanks for testing the code at that early stage), but this is the first tarball release. New tarballs for cxml and its other add-on projects are also available now, so that you don't have to juggle with git, darcs, and CVS anymore.

Beta version: SBCL-only

Plexippus is well-tested on SBCL, but has not yet been ported to any other Lisp implementation. That's why this release is declared as a beta version.

(Ports to other Lisps mainly involve support code for non-trapping floating-point arithmetic. Patches are welcome.)

The XPath protocol

For extensibility, Plexippus defines a protocol of generic functions to implement the XPath data model, so any object model for XML can be queried using Plexippus if it implements these generic functions. Out-of-the-box, there is support for cxml-STP (a DOM alternative) and cxml's DOM.

Some examples

Let's parse a test document first (no XPath involved yet):

CL-USER> (defparameter *document*
    (cxml:parse "<test a='1' b='2'>
                          <child>hello world</child>
                        </test>"
         (stp:make-builder)))
*DOCUMENT*

Find and add the two attributes as numbers:

CL-USER> (xpath:evaluate "test/@a + test/@b" *document*)
3.0d0

Find the element called child and its string value. (Using string() in the expression itself would also have worked.)

CL-USER> (xpath:string-value (xpath:evaluate "//child" *document*))
"hello world"

Iterate over all elements, in document order:

CL-USER> (xpath:do-node-set (node (xpath:evaluate "//*" *document*))
    (format t "found element: ~A~%"
     (xpath-protocol:local-name node)))
found element: test
found element: child

More examples here.

2008-07-26

lisp-berlin

[rumpfkluft.de]

Lispers are meeting up on a regular basis almost everywhere. But does Berlin have a Lisp user group? If so, where would you start looking for it? Until recently, the only resources available were the mailing lists eurolisp (targeting everyone and no one in particular) and lisp-hh (frequented by Hamburg Lispers).

Now, thanks to Hans, we have our own Wiki and mailing list. For your future Lisp needs in Berlin, we present lisp-berlin: http://groups.google.com/group/lisp-berlin

See lisp-berlin/treffen for Katrin's "Stammtisch", which has been a regular meeting for about a year now.

We would like to organize meetings replacing the Stammtisch later this year, ideally in a place that is not as excessively casual, so stay tuned for more.

2008-02-05

clbuild FAQ

Since bloggers started covering clbuild (1,2), there has been a noticable surge of newbie questions.

To record answers to those questions, there is now a longer FAQ for clbuild, covering these topics:

  • How does clbuild differ from asdf-install?
  • My favourite application is not supported. How can I add it?
  • Why did you get rid of all tarball-only downloads?
  • It doesn't load my ~/.sbclrc!
  • "clbuild lisp" doesn't seem to use my monster.core!
  • Can I start the lisp with swank already preloaded?
  • Can I run emacs and slime without going through "clbuild slime"?
  • Is the "dependencies" file autogenerated?
  • The "dependencies" file is broken!
  • Why is clbuild written in shell? Lisp is so much better.
  • Does it work on cygwin?

Note the slime-related changes, which allow swank startup the way Bill is explaining it in his post, but without the workarounds.