branch: elpa/llama
commit c1f4b4ff28fbb4e4bb72473b26b8fd103ccc3ca2
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    Update documentation
---
 README.md | 18 ++++++++++++++++++
 llama.el  | 28 ++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/README.md b/README.md
index 5512b64751..7757d7c724 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,24 @@ which expands to:
   (foo %1 (bar &3) &*))
 ```
 
+Unused trailing arguments and mandatory unused arguments at the
+border between mandatory and optional arguments are also supported:
+
+```elisp
+(##list %1 _%3 &5 _&6)
+```
+
+becomes:
+
+```elisp
+(lambda (%1 _%2 _%3 &optional _&4 &5 _&6)
+  (list %1 &5))
+```
+
+Note how `_%3` and `_&6` are removed from the body, because their
+names begin with an underscore.  Also note that `_&4` is optional,
+unlike the explicitly specified `_%3`.
+
 The name `##` was chosen because that allows (optionally)
 omitting the whitespace between it and the following symbol.
 It also looks similar to `#'function`.
diff --git a/llama.el b/llama.el
index 9f06a9cf90..3e72131795 100644
--- a/llama.el
+++ b/llama.el
@@ -61,6 +61,20 @@
 ;;   (lambda (%1 _%2 &optional &3 &rest &*)
 ;;     (foo %1 (bar &3) &*))
 
+;; Unused trailing arguments and mandatory unused arguments at the
+;; border between mandatory and optional arguments are also supported:
+;;
+;;   (##list %1 _%3 &5 _&6)
+;;
+;; becomes:
+;;
+;;   (lambda (%1 _%2 _%3 &optional _&4 &5 _&6)
+;;     (list %1 &5))
+;;
+;; Note how `_%3' and `_&6' are removed from the body, because their
+;; names begin with an underscore.  Also note that `_&4' is optional,
+;; unlike the explicitly specified `_%3'.
+
 ;; The name `##' was chosen because that allows (optionally)
 ;; omitting the whitespace between it and the following symbol.
 ;; It also looks similar to #'function.
@@ -100,6 +114,20 @@ which expands to:
   (lambda (%1 _%2 &optional &3 &rest &*)
     (foo %1 (bar &3) &*))
 
+Unused trailing arguments and mandatory unused arguments at the
+border between mandatory and optional arguments are also supported:
+
+  (##list %1 _%3 &5 _&6)
+
+becomes:
+
+  (lambda (%1 _%2 _%3 &optional _&4 &5 _&6)
+    (list %1 &5))
+
+Note how `_%3' and `_&6' are removed from the body, because their
+names begin with an underscore.  Also note that `_&4' is optional,
+unlike the explicitly specified `_%3'.
+
 The name `##' was chosen because that allows (optionally)
 omitting the whitespace between it and the following symbol.
 It also looks a bit like #\\='function."

Reply via email to