Prismatic/schema — pull request #167 by davegolland (2014-11-03 05:37:53+00:00)
Title: implementation of delimited sequence schema

Implements delimited sequence schema for matching delimited sequences.

An example of a delimited sequence is: `(s/delimited [s/Int] :delimiter [s/Str])` which would match `[1 2 3 4 :delimiter "a" "b" "c"]`. Here there is a sequence of integers, a single delimiter, and then a sequence of strings all concatted into the same vector. The matching is implemented by splitting the sequence on the delimiter, and then recursively matching each side. In the event of multiple delimiters, there is a flag to determine whether to match on the first or last occurrence.

The motivation is to make schema rich enough to express the sequences used in clojure's binding forms, such as: `(let [[a b :as args] [1 2]] ...)`. In this binding, the `:as` is the delimiter, and the left schema is a sequence of symbols, the right schema is a single symbol `[(s/one clojure.lang.Symbol "binding name")]`.