This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
blind is now clojure.tools.reader
- Loading branch information
Showing
4 changed files
with
1 addition
and
1,171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,3 @@ | ||
# blind | ||
|
||
A complete clojure reader implemented in clojure itself. | ||
|
||
## Installation | ||
|
||
In Leiningen: | ||
|
||
```clojure | ||
:dependencies [[bronsa/blind "0.5.0"]] | ||
``` | ||
|
||
## NOTE | ||
|
||
On my machine it reads core.clj 1.5x times slower than clojure's reader | ||
|
||
## Usage | ||
|
||
In `blind.reader` are available `read`, `read-string` and `read-line`, they have the same semantics of clojure.core ones. | ||
|
||
`read-string` uses internally a blind.reader.StringReader with fast peek-char semantics. | ||
|
||
`read` and `read-line` work as their clojure.core counterparts, requiring a `blind.reader.IPushbackReader` (Read the end of usage for java.io.PushbackReader) | ||
|
||
`blind.reader` also provides `string-reader`, `input-stream-reader`, `string-push-back-reader`, `input-stream-push-back-reader` and `indexing-push-back-reader`. | ||
|
||
`indexing-push-back-reader` takes a string or a `blind.reader.IPushbackreader` and an optional pushback buffer size and returns a blind.reader.IndexingPushbackReader that can be used with `read` to get column/line infos. | ||
|
||
Note that `blind.reader.Reader` and `blind.reader.PushbackReader` have been extended to `java.io.PushbackReader` so both `java.io.PushbackReader` and `clojure.lang.LineNumberingPushbackReader` work as `blind.reader.PushbackReader`s | ||
|
||
## Differences from clojure's reader | ||
|
||
There are small differences from clojure's LispReader.java: | ||
|
||
`blind.reader/read` throws an `ex-info` for almost every exception, whereas `clojure.lang.LispReader/read` throws a `ReaderException` wrapping the causing exception. | ||
|
||
`blind.reader/read` is capable of reading `\x` escaped chars | ||
|
||
`blind.reader/read` is capable of reading `Infinity` `+Infinity` `-Infinity` and `NaN` as per #CLJ-1074 | ||
|
||
`blind.reader/read` is capable of reading literal tags contaning periods, fixing #CLJ-1100 | ||
|
||
`blind.reader/read` checks if `blind.reader/*alias-map*` is bound, if that's the case, aliases will be resolved by querying it (must be a map), otherwhise (ns-aliases *ns*) will be used | ||
|
||
`blind.reader/read-line` has an additional arity with which is possible to specify the reader to read from | ||
|
||
## License | ||
|
||
Copyright © 2012 Bronsa | ||
|
||
Distributed under the Eclipse Public License, the same as Clojure. | ||
blind has moved to clojure contrib! [Check out tools.reader the new repository](https://github.com/clojure/tools.reader) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.