Skip to content

Commit 45b4138

Browse files
correct tag names, doc tweaks
1 parent f915c92 commit 45b4138

File tree

3 files changed

+14
-32
lines changed

3 files changed

+14
-32
lines changed

README.md

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
data.fressian
2-
========================================
1+
# data.fressian
32

43
Read and write fressian data. See http://edn-format.org/
54

6-
Releases and Dependency Information
7-
----------------------------------------
5+
# Releases and Dependency Information
86

97
[Leiningen](https://github.com/technomancy/leiningen) dependency information:
108

@@ -26,10 +24,7 @@ Other versions:
2624

2725
* [Development Snapshot Repositories](http://dev.clojure.org/display/doc/Maven+Settings+and+Repositories)
2826

29-
30-
31-
Usage
32-
----------------------------------------
27+
# Usage
3328

3429
[API Documentation](http://clojure.github.com/data.fressian/)
3530

@@ -45,14 +40,13 @@ Examples:
4540
(fress/create-reader is)
4641
(fress/create-writer os)
4742

48-
;; all read/write functions tate optional handlers
43+
;; all read/write functions take optional handlers
4944
(fress/write x :handlers my-handlers)
5045

5146
Other options are available. Refer to the [API Documentation](http://clojure.github.com/data.fressian/) for details.
5247

5348

54-
Developer Information
55-
----------------------------------------
49+
# Developer Information
5650

5751
* [GitHub project](https://github.com/clojure/data.fressian)
5852

@@ -63,13 +57,7 @@ Developer Information
6357
* [Compatibility Test Matrix](http://build.clojure.org/job/data.fressian-test-matrix/)
6458

6559

66-
67-
Change Log
68-
----------------------------------------
69-
70-
71-
Copyright and License
72-
----------------------------------------
60+
# Copyright and License
7361

7462
Copyright (c) Cognitect, Inc. All rights reserved. The use and
7563
distribution terms for this software are covered by the Eclipse Public

src/main/clojure/clojure/data/fressian.clj

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,7 @@
7070

7171
(def clojure-write-handlers
7272
"Standard set of write handlers for Clojure data."
73-
{Byte
74-
{"byte"
75-
(reify WriteHandler
76-
(write [_ w b]
77-
(.writeTag w "byte" 1)
78-
(.writeInt w (int b))))}
79-
80-
Character
73+
{Character
8174
{"char"
8275
(reify WriteHandler
8376
(write [_ w ch]
@@ -92,7 +85,7 @@
9285
(.writeObject w (.denominator ^Ratio n))))}
9386

9487
IRecord
95-
{"record"
88+
{"clojure/record"
9689
(reify WriteHandler
9790
(write [_ w rec]
9891
(.writeTag w "record" 2)
@@ -199,14 +192,16 @@
199192

200193
(defn ^Writer create-writer
201194
"Create a fressian writer targeting out. Handlers must be
202-
a nested map of type => tag => WriteHandler."
195+
a nested map of type => tag => WriteHandler, see
196+
clojure-write-handlers for an example."
203197
[^OutputStream out & {:keys [handlers]}]
204198
(FressianWriter. out (or handlers (-> clojure-write-handlers associative-lookup inheritance-lookup))))
205199

206200
(defn ^Reader create-reader
207201
"Create a fressian reader targeting in, which must be compatible
208-
with clojure.java.io/input-stream. handlers can be an ILookup or
209-
a map of tag => ReadHandler."
202+
with clojure.java.io/input-stream. Handlers can be an ILookup
203+
or a map of tag => ReadHandler, see clojure-read-handlers for
204+
an example."
210205
[^InputStream in & {:keys [handlers checksum?]}]
211206
(FressianReader. in
212207
(or handlers (associative-lookup clojure-read-handlers))

src/test/clojure/clojure/data/fressian_test.clj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@
5353
(defn data-with-handler
5454
"Generate data that has data.fressian specific handler"
5555
[]
56-
(gen/one-of #(.byteValue (gen/byte))
57-
gen/char
56+
(gen/one-of gen/char
5857
gen/ratio
5958
gen/bigint
6059
gen-example-record

0 commit comments

Comments
 (0)