Skip to content

Instantly share code, notes, and snippets.

@lynaghk
lynaghk / gist:5174289
Created March 16, 2013 00:30
Hacky "tagged literals" in JSON.
;;5-minute sketch of tagged literals in JSON via the little known second argument to the browser's JSON.parse.
;;It's no EDN, but it's still a hell of a lot nicer than the usual JSON-deserialization state of affairs.
(ns shim.json
(:require [goog.date.DateTime :as DateTime]))
(defn parse-tagged-string
"Parse a tagged string within JSON.
Assumes string begins with a throwaway first character and there is a single space between the tag and its data."