branch: elpa/llama commit 6e13fa51e86fdfd967a8a063c0797ea78c0ffea7 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
##: Rename ARGS argument to BODY That's kinda the point, isn't it? We only have to provide the body and the arguments are deduced from that. This change does lead to some dissonance in existing descriptions, which will have to be reduced. --- README.md | 12 ++++++------ llama.el | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index e86bc0c7dd..5512b64751 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,16 @@ which would be difficult to get merged into Emacs. Past attempts to add syntax were met with determined pushback and the use of a macro was suggested as an alternative. -The `##` macro, whose signature is `(## FN &rest ARGS)`, expands -to a `lambda` expression, which wraps around its arguments. +The `##` macro, whose signature is `(## FN &rest BODY)`, expands +to a `lambda` expression, which wraps around these arguments. This `lambda` expression calls the function FN with arguments -ARGS and returns its value. Its own arguments are derived from -symbols found in ARGS. +BODY and returns its value. Its own arguments are derived from +symbols found in BODY. -Each symbol from `%1` through `%9`, which appears in ARGS, +Each symbol from `%1` through `%9`, which appears in BODY, specifies an argument. Each symbol from `&1` through `&9`, which -appears in ARGS, specifies an optional argument. All arguments +appears in BODY, specifies an optional argument. All arguments following an optional argument have to be optional as well, thus their names have to begin with `&`. Symbol `&*` specifies extra (`&rest`) arguments. diff --git a/llama.el b/llama.el index 5a4062f1b7..ec4c54b8a2 100644 --- a/llama.el +++ b/llama.el @@ -29,16 +29,16 @@ ;; to add syntax were met with determined pushback and the use of a ;; macro was suggested as an alternative. -;; The `##' macro, whose signature is (## FN &rest ARGS), expands -;; to a `lambda' expression, which wraps around its arguments. +;; The `##' macro, whose signature is (## FN &rest BODY), expands +;; to a `lambda' expression, which wraps around these arguments. ;; This `lambda' expression calls the function FN with arguments -;; ARGS and returns its value. Its own arguments are derived from +;; BODY and returns its value. Its own arguments are derived from ;; symbols found in ARGS. -;; Each symbol from `%1' through `%9', which appears in ARGS, +;; Each symbol from `%1' through `%9', which appears in BODY, ;; specifies an argument. Each symbol from `&1' through `&9', which -;; appears in ARGS, specifies an optional argument. All arguments +;; appears in BODY, specifies an optional argument. All arguments ;; following an optional argument have to be optional as well, thus ;; their names have to begin with `&'. Symbol `&*' specifies extra ;; (`&rest') arguments. @@ -68,16 +68,16 @@ ;;; Code: ;;;###autoload -(defmacro ## (fn &rest args) - "Expand to a `lambda' expression that wraps around FN and ARGS. +(defmacro ## (fn &rest body) + "Expand to a `lambda' expression that wraps around FN and BODY. This `lambda' expression calls the function FN with arguments -ARGS and returns its value. Its own arguments are derived from -symbols found in ARGS. +BODY and returns its value. Its own arguments are derived from +symbols found in BODY. -Each symbol from `%1' through `%9', which appears in ARGS, +Each symbol from `%1' through `%9', which appears in BODY, specifies an argument. Each symbol from `&1' through `&9', which -appears in ARGS, specifies an optional argument. All arguments +appears in BODY, specifies an optional argument. All arguments following an optional argument have to be optional as well, thus their names have to begin with `&'. Symbol `&*' specifies extra \(`&rest') arguments. @@ -105,8 +105,8 @@ omitting the whitespace between it and the following symbol. It also looks a bit like #\\='function." (unless (symbolp fn) (signal 'wrong-type-argument (list 'symbolp fn))) - `(lambda ,(llama--arguments args) - (,fn ,@args))) + `(lambda ,(llama--arguments body) + (,fn ,@body))) (defun llama--arguments (data) (let ((args (make-vector 10 nil))