[SUBDIRMK RFC v2 REPOST 4/4] README: v2: $-doubling and macro assistance
Ian Jackson
ijackson at chiark.greenend.org.uk
Thu Dec 19 00:53:18 GMT 2019
Provide a $-doubling regime which can be used for macros - and also
for complex recipe runes.
Use this to provide a way to write macros that seem like they will
work properly. The rule-definition-macro-invocation syntax uses
${ } by analogy with block-structred languages.
Not implemented yet. Also no S-o-b at this time!
---
README | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/README b/README
index f726f9c..e9aef3a 100644
--- a/README
+++ b/README
@@ -321,6 +321,34 @@ So pathname syntax is a subset of:
`all' is extra special: every directory has an `all'
target, which corresponds to &TARGETS.
+
+DOLLAR DOUBLING AND MACRO ASSISTANCE
+------------------------------------
+
+$+ Starts dollar-doubling
+$- Stops dollar-doubling
+ Both are idempotent and local to the file or context. Where
+ we say "... is $-doubled" we mean $-doubling is locally
+ enabled, and restored afterwards.
+
+While dollar-doubling:
+
+$ => $$ including $'s produced by other
+ &-expansions not mentioned here
+
+&\$ => $
+&$NN => $(NN) where N are digits
+&$( => $(
+
+&:macro NAME => define NAME
+STUFF STUFF [but $-doubled]
+&:endm endef
+
+&${...} => ${eval ${call ...}}
+ (matches { } pairs to find the end)
+ ... is $-doubled (unless it contains $- to turn that off)
+
+
Subdirectory and variable naming
--------------------------------
--
2.11.0
More information about the sgo-software-discuss
mailing list