Skip to content

Commit d847f93

Browse files
authored
Update Ion 1.1 spec with feedback from final comment period (#390)
1 parent 549876d commit d847f93

File tree

17 files changed

+312
-350
lines changed

17 files changed

+312
-350
lines changed

_books/ion-1-1/src/SUMMARY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
* [timestamp](binary/values/timestamp.md)
3737
* [string](binary/values/string.md)
3838
* [symbol](binary/values/symbol.md)
39-
* [blob](binary/values/lob.md)
40-
* [clob](binary/values/lob.md)
39+
* [blob](binary/values/blob.md)
40+
* [clob](binary/values/clob.md)
4141
* [list](binary/values/list.md)
4242
* [sexp](binary/values/sexp.md)
4343
* [struct](binary/values/struct.md)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Blobs
2+
3+
Opcode `FE` indicates a blob of binary data. A `FlexUInt` follows that represents the blob's byte-length.
4+
5+
`0xEB x07` represents `null.blob`.
6+
7+
### Example `blob` encoding
8+
```
9+
┌──── Opcode FE indicates a blob, FlexUInt length follows
10+
│ ┌─── Length: FlexUInt 24
11+
│ │
12+
FE 31 49 20 61 70 70 6c 61 75 64 20 79 6f 75 72 20 63 75 72 69 6f 73 69 74 79
13+
└────────────────────────────────┬────────────────────────────────────┘
14+
24 bytes of binary data
15+
```
16+
17+
### Encoding of `null.blob`
18+
```
19+
┌──── Opcode 0xEB indicates a typed null; a byte follows specifying the type
20+
│ ┌─── Null type: blob
21+
│ │
22+
EB 07
23+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Clobs
2+
3+
Opcode `FF` indicates a clob--binary character data of an unspecified encoding. A `FlexUInt` follows that represents
4+
the clob's byte-length.
5+
6+
`0xEB x08` represents `null.clob`.
7+
8+
### Example `clob` encoding
9+
```
10+
┌──── Opcode FF indicates a clob, FlexUInt length follows
11+
│ ┌─── Length: FlexUInt 24
12+
│ │
13+
FF 31 49 20 61 70 70 6c 61 75 64 20 79 6f 75 72 20 63 75 72 69 6f 73 69 74 79
14+
└────────────────────────────────┬────────────────────────────────────┘
15+
24 bytes of binary data
16+
```
17+
18+
### Encoding of `null.clob`
19+
```
20+
┌──── Opcode 0xEB indicates a typed null; a byte follows specifying the type
21+
│ ┌─── Null type: clob
22+
│ │
23+
EB 08
24+
```

_books/ion-1-1/src/binary/values/lob.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

_books/ion-1-1/src/grammar.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ encoding-directive ::= '$ion::(encoding ' module-name* ')'
2727

2828
### Modules
2929
```bnf
30-
module-body ::= import* inner-module* symbol-table? macro-table?
30+
module-body ::= import* inner-module* macro-table? symbol-table?
3131
3232
shared-module ::= '$ion_shared_module::' ivm '::(' catalog-key module-body ')'
3333
@@ -43,15 +43,15 @@ inner-module ::= '(module' module-name module-body ')'
4343
4444
module-name ::= unannotated-identifier-symbol
4545
46-
symbol-table ::= '(symbol_table' symbol-table-entry* ')'
46+
symbol-table ::= '(symbols' symbol-table-entry* ')'
4747
4848
symbol-table-entry ::= module-name | symbol-list
4949
5050
symbol-list ::= '[' symbol-text* ']'
5151
5252
symbol-text ::= symbol | string
5353
54-
macro-table ::= '(macro_table' macro-table-entry* ')'
54+
macro-table ::= '(macros' macro-table-entry* ')'
5555
5656
macro-table-entry ::= macro-definition
5757
| macro-export

_books/ion-1-1/src/macros/defining_macros.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Defining macros
22

3-
A macro is defined using a `macro` clause within a [module](../modules.md)'s [`macro_table` clause](../modules.md#macro_table).
3+
A macro is defined using a `macro` clause within a [module](../modules.md)'s [`macros` clause](../modules.md#macros).
44

55
## Syntax
66
```ion
@@ -204,7 +204,7 @@ When they are invoked, they expand to a stream of a single value: the Ion scalar
204204
```ion
205205
$ion::
206206
(module _
207-
(macro_table
207+
(macros
208208
(macro greeting () "hello")
209209
(macro birthday () 1996-10-11)
210210
// Annotations are also literal
@@ -262,7 +262,7 @@ expression-group ::= '(..' expression* ')'
262262
```ion
263263
$ion::
264264
(module _
265-
(macro_table
265+
(macros
266266
// Calls the system macro `values`, allowing it to produce a stream of three values.
267267
(macro nephews () (.values Huey Dewey Louie))
268268
@@ -283,7 +283,7 @@ $ion::
283283
> ```ion
284284
> $ion::
285285
> (module _
286-
> (macro_table
286+
> (macros
287287
> (macro list_of_nephews () [(.nephews)])
288288
> // ^^^^^^^^
289289
> // ERROR: Calls a macro that has not yet been defined in this module.
@@ -311,7 +311,7 @@ variable-name ::= ion-identifier
311311
```ion
312312
$ion::
313313
(module _
314-
(macro_table
314+
(macros
315315
// Produces a stream that repeats the content of parameter `x` twice.
316316
(macro twice (x*) (.values (%x) (%x)))
317317
)
@@ -342,7 +342,7 @@ If the expansion was empty, no values are spliced into the container.
342342
```ion
343343
$ion::
344344
(module _
345-
(macro_table
345+
(macros
346346
(macro bookend_list (x y*) [(%x), (%y), (%x)])
347347
(macro bookend_sexp (x y*) ((%x) (%y) (%x)))
348348
)
@@ -366,7 +366,7 @@ If the expansion was empty, no fields are spliced into the parent struct.
366366
```ion
367367
$ion::
368368
(module _
369-
(macro_table
369+
(macros
370370
(macro resident (id names*)
371371
{
372372
town: "Riverside",

_books/ion-1-1/src/macros/special_forms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ Embedded text example:
264264
(:parse_ion
265265
'''
266266
$ion_1_1
267-
$ion::(module _ (symbol_table ["foo" "bar"]]))
267+
$ion::(module _ (symbols ["foo" "bar"]]))
268268
$1 $2
269269
'''
270270
)

0 commit comments

Comments
 (0)