Skip to content

Commit 20402e9

Browse files
authored
Remove wording around macro name omission (#393)
* Update wording around anonymous macros to match existing conformance tests and implementations * Adjust wording based on PR feedback
1 parent 3670540 commit 20402e9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ A macro is defined using a `macro` clause within a [module](../modules.md)'s [`m
77
(macro name signature template)
88
```
99

10-
| Argument | Description |
11-
|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
12-
| [`name`](#macro-names) | A unique name assigned to the macro. When constructing an anonymous macro, this argument is omitted. |
13-
| [`signature`](#macro-signatures) | An s-expression enumerating the parameters this macro accepts. |
14-
| [`template`](#template-definition-language-tdl) | A template definition language (TDL) expression that can be evaluated to produce zero or more Ion values. |
10+
| Argument | Description |
11+
|-------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
12+
| [`name`](#macro-names) | A unique name assigned to the macro. When constructing an anonymous macro `null` is used in the place of a unique name. |
13+
| [`signature`](#macro-signatures) | An s-expression enumerating the parameters this macro accepts. |
14+
| [`template`](#template-definition-language-tdl) | A template definition language (TDL) expression that can be evaluated to produce zero or more Ion values. |
1515

1616
### Example macro clause
1717
```ion
@@ -32,7 +32,7 @@ A macro is defined using a `macro` clause within a [module](../modules.md)'s [`m
3232
Syntactically, macro names are [identifiers](../text/symbol-tokens.md). Each macro name in a macro table must be unique.
3333

3434
In some circumstances, it may not make sense to name a macro. (For example, when the macro is generated automatically.)
35-
In such cases, authors may omit the macro name to indicate that the macro does not have a name.
35+
In such cases, authors must use `null` to indicate that the macro does not have a name.
3636
Anonymous macros can only be referenced by their address in the macro table.
3737

3838
## Macro parameters

_books/ion-1-1/src/modules/defining_modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Most commonly, a macro table entry is a definition of a new macro expansion func
119119
```
120120
(See the [_Defining macros_](../macros/defining_macros.md) for details.)
121121

122-
When no name is given, this defines an anonymous macro that can be referenced by its numeric
122+
When the value `null` is given for the macro name, this defines an anonymous macro that can be referenced by its numeric
123123
address (that is, its index in the enclosing macro table).
124124
Inside the defining module, that uses a local reference like `12`.
125125

0 commit comments

Comments
 (0)