You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-6
Original file line number
Diff line number
Diff line change
@@ -1691,7 +1691,7 @@ Metatronic macros make a lot of this pain go away: just give the symbols you wan
1691
1691
,@forms)))
1692
1692
```
1693
1693
1694
-
All that happens is that each symbol whose name looks like `<...>` is rewritten as a gensymized version of itself, with each identical symbol being rewritten to the same thing[^17]. As a special case, symbols whose names are `"<>"` are rewritten as unique gensymized symbols[^18].
1694
+
All that happens is that each symbol whose name looks like `<...>` is rewritten as a gensymized version of itself, with each identical symbol being rewritten to the same thing[^17]. As a special case, symbols whose names are `"<>"` are rewritten as unique gensymized symbols[^18]. The pattern symbols must match is controlled by a 'rewriter' function which can be changed if you don't like the default: see below.
1695
1695
1696
1696
With the above definition
1697
1697
@@ -1721,9 +1721,7 @@ where, in this case, all the `#:<in>` symbols are the same symbol.
1721
1721
-`form` is the form to be rewritten;
1722
1722
-`rewrites`, if given, is a table of rewrites returned from a previous call to `metatronize`;
1723
1723
-`sharing`, if given, is a table with information on structure sharing from a previous call to `metatronize` which it will use to possibly share structure with the `form` argument to that previous call;
1724
-
-`rewriter`, if given, is a function of one argument, a symbol, which should return either its argument and any value or a gensymized version of it and an indication of whether it should be stored in the rewrite table.
1725
-
1726
-
If the last argument is given then it is used instead of the builtin metatronizer, so you can define your own notion of what symbols should be gensymized.
1724
+
-`rewriter`, if given, is a function of one argument, a symbol, which should return either its argument and any value or a gensymized version of it and an indication of whether it should be stored in the rewrite table. The default value is `*default-metatronize-rewriter*`.
1727
1725
1728
1726
`metatronize` returns four values:
1729
1727
@@ -1732,6 +1730,8 @@ If the last argument is given then it is used instead of the builtin metatronize
1732
1730
- a list of unique symbols, which are usually the symbols that symbols whose names are `<>`get rewritten to;
1733
1731
- a sharing table describing shared structure in the form.
1734
1732
1733
+
**`*default-metatronize-symbol-rewriter*`** is bound to the default symbol rewriter used by `metatronize`. Changing it will change the behaviour of `metatronize` and therefore of `defmacro/m` and `macrolet/m`. Reloading `metatronic` will reset it if you break things.
1734
+
1735
1735
### Notes
1736
1736
Macros written with `defmacro/m` and `macrolet/m` in fact metatronize symbols *twice*: once when the macro is defined, and then again when it is expanded, using lists of rewritten & unique symbols from the first metatronization to drive a `rewriter` function. This ensures that each expansion has a unique set of gensymized symbols: with the above definition of `with-file-lines`, then
1737
1737
@@ -2114,8 +2114,6 @@ I'm not completely convinced by the precision time code.
2114
2114
2115
2115
Logging to pathnames rather than explicitly-managed streams may be a little slower, but seems now to be pretty close.
2116
2116
2117
-
`slog` will *certainly* turn into something which isn't a toy fairly soon: consider this an ephemeral version.
2118
-
2119
2117
### Package, module
2120
2118
`slog` lives in and provides `:org.tfeb.hax.slog`.
0 commit comments