diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/concepts/expressions.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/concepts/expressions.md b/doc/concepts/expressions.md index c5d120e4..aaea3d27 100644 --- a/doc/concepts/expressions.md +++ b/doc/concepts/expressions.md @@ -79,6 +79,27 @@ evaluation. The value is the value of the key `"$1"` uninterpreted, if present, and `null` otherwise. +##### Quasi-Quoting: ``"`"`` + +The value is the value of the key `"$1"` uninterpreted but replacing +all outermost maps having a key `"type"` with the value either +`","` or `",@"` in the following way. + - If the value for the key `"type"` is `","`, the value for the + key `"$1"` (or `null` if there is no key `"$1"`) is evaluated + and the map is replaced by the value of that evaluation. + - If the value for the key `"type"` is `",@"` it is an error if + that map is not an entry of a literal list. The value for the + key `"$1"` (or `[]` if there is no key `"$1"`) is evaluated; + the result of that evaluation has to be a list. The entries of + that list (i.e., the list obtained by evaluating the value for + `"$1"`) are inserted (not the list itself) into the surrounding + list replacing that map. +For example, ``{"type": "`", "$1": [1, 2, {"type": ",@", "$1": [3, 4]}]}`` +evaluates to `[1, 2, 3, 4]` while +``{"type": "`", "$1": [1, 2, {"type": ",", "$1": [3, 4]}]}`` +evaluates to `[1, 2, [3, 4]]`. + + ##### Sequential binding: `"let*"` The key `"bindings"` (default `[]`) has to be (syntactically) a |