SPath is a library for running search queries against s-expressions, intended to match parts of them that the user needs. It is inspired by s-query, the syntax of LOOP, and loosely by XPath; not that it has the full expressive power of XPath, but some of the stylistic choices and ideas were taken from there. In particular, SPath finds all instances of a match in the same sort of way as XPath.

In other words, it's a DSL for pulling bits out of lists.

The goal of SPath, like s-query, was to provide a means to easily dig around in XML structures when represented as s-expressions, but unlike s-query I tried to do it in a fashion agnostic to the XML generation system in question. I also consider it of general utility, because I get sick of writing nests of list operations.

It was created by Robin Lee Powell, and is in the public domain.

SPath requires Heresy.

Documentation, such as it is, can be found at the SPath readme. The SPath test suite should also effectively document everything SPath can do, albeit not in a very readable fashion.

Topics: pattern matching