Fix examples; tweak opening text
This commit is contained in:
parent
5aee3af65a
commit
01a766c974
|
@ -7,7 +7,7 @@ no_site_title: true
|
|||
|
||||
This [repository]({{page.projectpages}}) contains a
|
||||
[definition](preserves.html) and various implementations of *Preserves*, a
|
||||
new data model, with associated serialization formats, in many ways
|
||||
data model with associated serialization formats in many ways
|
||||
comparable to JSON, XML, S-expressions, CBOR, ASN.1 BER, and so on.
|
||||
|
||||
## Core documents
|
||||
|
|
60
preserves.md
60
preserves.md
|
@ -199,22 +199,22 @@ The total ordering specified [above](#total-order) means that the following stat
|
|||
| Value | Encoded byte sequence |
|
||||
|-----------------------------------------------------|---------------------------------------------------------------------------------|
|
||||
| `<capture <discard>>` | B4 B3 07 'c' 'a' 'p' 't' 'u' 'r' 'e' B4 B3 07 'd' 'i' 's' 'c' 'a' 'r' 'd' 84 84 |
|
||||
| `[1 2 3 4]` | B5 91 92 93 94 84 |
|
||||
| `[-2 -1 0 1]` | B5 9E 9F 90 91 84 |
|
||||
| `[1 2 3 4]` | B5 B0 01 01 B0 01 02 B0 01 03 B0 01 04 84 |
|
||||
| `[-2 -1 0 1]` | B5 B0 01 FE B0 01 FF B0 00 B0 01 01 84 |
|
||||
| `"hello"` | B1 05 'h' 'e' 'l' 'l' 'o' |
|
||||
| `"z水𝄞"` | B1 08 'z' E6 B0 B4 F0 9D 84 9E |
|
||||
| `"z水\uD834\uDD1E"` | B1 08 'z' E6 B0 B4 F0 9D 84 9E |
|
||||
| `["a" b #"c" [] #{} #t #f]` | B5 B1 01 'a' B3 01 'b' B2 01 'c' B5 84 B6 84 81 80 84 |
|
||||
| `-257` | A1 FE FF |
|
||||
| `-1` | 9F |
|
||||
| `0` | 90 |
|
||||
| `1` | 91 |
|
||||
| `255` | A1 00 FF |
|
||||
| `1.0f` | 82 3F 80 00 00 |
|
||||
| `1.0` | 83 3F F0 00 00 00 00 00 00 |
|
||||
| `-1.202e300` | 83 FE 3C B7 B7 59 BF 04 26 |
|
||||
| `#xf"7f800000"`, positive `Float` infinity | 82 7F 80 00 00 |
|
||||
| `#xd"fff0000000000000"`, negative `Double` infinity | 83 FF F0 00 00 00 00 00 00 |
|
||||
| `-257` | B0 02 FE FF |
|
||||
| `-1` | B0 01 FF |
|
||||
| `0` | B0 00 |
|
||||
| `1` | B0 01 01 |
|
||||
| `255` | B0 02 00 FF |
|
||||
| `1.0f` | 87 04 3F 80 00 00 |
|
||||
| `1.0` | 87 08 3F F0 00 00 00 00 00 00 |
|
||||
| `-1.202e300` | 87 08 FE 3C B7 B7 59 BF 04 26 |
|
||||
| `#xf"7f800000"`, positive `Float` infinity | 87 04 7F 80 00 00 |
|
||||
| `#xd"fff0000000000000"`, negative `Double` infinity | 87 08 FF F0 00 00 00 00 00 00 |
|
||||
|
||||
The next example uses a non-`Symbol` label for a record.[^extensibility2] The `Record`
|
||||
|
||||
|
@ -226,17 +226,17 @@ encodes to
|
|||
B5 ;; Sequence
|
||||
B3 06 74 69 74 6C 65 64 ;; Symbol, "titled"
|
||||
B3 06 70 65 72 73 6F 6E ;; Symbol, "person"
|
||||
92 ;; SignedInteger, "2"
|
||||
B0 01 02 ;; SignedInteger, "2"
|
||||
B3 05 74 68 69 6E 67 ;; Symbol, "thing"
|
||||
91 ;; SignedInteger, "1"
|
||||
B0 01 01 ;; SignedInteger, "1"
|
||||
84 ;; End (sequence)
|
||||
A0 65 ;; SignedInteger, "101"
|
||||
B0 01 65 ;; SignedInteger, "101"
|
||||
B1 09 42 6C 61 63 6B 77 65 6C 6C ;; String, "Blackwell"
|
||||
B4 ;; Record
|
||||
B3 04 64 61 74 65 ;; Symbol, "date"
|
||||
A1 07 1D ;; SignedInteger, "1821"
|
||||
92 ;; SignedInteger, "2"
|
||||
93 ;; SignedInteger, "3"
|
||||
B0 02 07 1D ;; SignedInteger, "1821"
|
||||
B0 01 02 ;; SignedInteger, "2"
|
||||
B0 01 03 ;; SignedInteger, "3"
|
||||
84 ;; End (record)
|
||||
B1 02 44 72 ;; String, "Dr"
|
||||
84 ;; End (record)
|
||||
|
@ -305,20 +305,20 @@ as follows:
|
|||
B1 05 "Image"
|
||||
B7
|
||||
B1 03 "IDs" B5
|
||||
A0 74
|
||||
A1 03 AF
|
||||
A1 00 EA
|
||||
A2 00 97 89
|
||||
B0 01 74
|
||||
B0 02 03 AF
|
||||
B0 02 00 EA
|
||||
B0 03 00 97 89
|
||||
84
|
||||
B1 05 "Title" B1 14 "View from 15th Floor"
|
||||
B1 05 "Width" A1 03 20
|
||||
B1 06 "Height" A1 02 58
|
||||
B1 05 "Width" B0 02 03 20
|
||||
B1 06 "Height" B0 02 02 58
|
||||
B1 08 "Animated" B3 05 "false"
|
||||
B1 09 "Thumbnail"
|
||||
B7
|
||||
B1 03 "Url" B1 26 "http://www.example.com/image/481989943"
|
||||
B1 05 "Width" A0 64
|
||||
B1 06 "Height" A0 7D
|
||||
B1 05 "Width" B0 01 64
|
||||
B1 06 "Height" B0 01 7D
|
||||
84
|
||||
84
|
||||
84
|
||||
|
@ -357,8 +357,8 @@ encodes to binary as follows:
|
|||
B1 05 "State" B1 02 "CA"
|
||||
B1 07 "Address" B1 00
|
||||
B1 07 "Country" B1 02 "US"
|
||||
B1 08 "Latitude" 83 40 42 E2 26 80 9D 49 52
|
||||
B1 09 "Longitude" 83 C0 5E 99 56 6C F4 1F 21
|
||||
B1 08 "Latitude" 87 08 40 42 E2 26 80 9D 49 52
|
||||
B1 09 "Longitude" 87 08 C0 5E 99 56 6C F4 1F 21
|
||||
B1 09 "precision" B1 03 "zip"
|
||||
84
|
||||
B7
|
||||
|
@ -367,8 +367,8 @@ encodes to binary as follows:
|
|||
B1 05 "State" B1 02 "CA"
|
||||
B1 07 "Address" B1 00
|
||||
B1 07 "Country" B1 02 "US"
|
||||
B1 08 "Latitude" 83 40 42 AF 9D 66 AD B4 03
|
||||
B1 09 "Longitude" 83 C0 5E 81 AA 4F CA 42 AF
|
||||
B1 08 "Latitude" 87 08 40 42 AF 9D 66 AD B4 03
|
||||
B1 09 "Longitude" 87 08 C0 5E 81 AA 4F CA 42 AF
|
||||
B1 09 "precision" B1 03 "zip"
|
||||
84
|
||||
84
|
||||
|
|
Loading…
Reference in New Issue