uri-template

Introduction

uri-template is a Common Lisp implementation of URI templates as a reader macro, permitting both template interpolation and destructuring.

Example use explains the concept best:


(let ((foo 1))
  #Uhttp://www.example.com/widget/{foo}/parts)

=> "http://www.example.com/widget/1/parts"

(uri-template-bind (#Uhttp://www.example.com/{part}/{(#'parse-integer number)})
    "http://www.example.com/widget/1"
  (list part number %uri-host))

=> ("widget" 1 "www.example.com")

Download

The latest version of uri-template is 0.8, and can be downloaded here. Older versions can be downloaded from the release directory.

uri-template is available via ASDF-Install: (asdf-install:install :uri-template)

Notes

uri-template goes beyond the proposed URI template standard for interpolation by allowing any single Lisp form as the placeholder (the consequences are undefined if multiple forms are provided).

uri-template works with Parenscript to provide template interpolation in JavaScript. To enable this functionality, load Parenscript before compiling uri-template. Note that destructuring is currently unsupported for Parenscript.

Mailing list

uri-template-devel

Project members

uri-template is authored by Vladimir Sedach.

License

uri-template is licensed under the terms of the BSD license. Details are contained in the COPYING file, included with the distribution.

The license was modified to reflect that Vladimir Sedach, not the Regents of the University of California, is the author.