[total-reader "1.0.0"]
A clojure reader which can read keywords with namespace aliases.
It should be able to read all idiomatic clojure files.
Built on top of org.clojure/tools.reader.
Extracted from https://github.com/jonase/kibit, which introduced this functionality to fix https://github.com/jonase/kibit/issues/14
If you want to be able to read a file containing namespace aliased keywords, map namespace syntax or namespaced map binding destructuring.
(ns keyword-namespace-test
(:require [clojure.string :as string]))
;; namespace aliased keyword
::string/test
;; map namespace syntax using an alias
(let [m #::string{:key1 "val"
:key2 "other val"}
;; namespaced map binding destructuring using an alias
{::string/keys [key1 key2]} m]
[key1 key2])
(require 'total-reader.core :as reader)
(reader/read-file
(-> "path/to/file.clj"
io/reader
LineNumberingPushbackReader.)
'user)
Copyright © 2018 Timo Freiberg
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close