summaryrefslogtreecommitdiff
path: root/llama.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2024-09-15 18:29:32 +0200
committerJonas Bernoulli <jonas@bernoul.li>2024-09-15 18:29:32 +0200
commitaab72b513fc661ddc76abf55ab2437bc56f86202 (patch)
tree3a589af95e368c9ca934f3a7f4f88377705179d0 /llama.el
parenta5fb525684260dee7c3381740e61421f7bb0ecc3 (diff)
Support backquote construct in place of FN
Diffstat (limited to 'llama.el')
-rw-r--r--llama.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/llama.el b/llama.el
index 44a66c0..e80f7d4 100644
--- a/llama.el
+++ b/llama.el
@@ -135,8 +135,13 @@ The name `##' was chosen because that allows (optionally) omitting
the whitespace between it and the following symbol. If you dislike
this trickery, you can alternatively use this macro under the name
`llama'."
- (unless (symbolp fn)
- (signal 'wrong-type-argument (list 'symbolp fn)))
+ (cond ((symbolp fn))
+ ((and (eq (car-safe fn) backquote-backquote-symbol)
+ (not body))
+ (setq body (cdr fn))
+ (setq fn backquote-backquote-symbol))
+ ((signal 'wrong-type-argument
+ (list 'symbolp backquote-backquote-symbol fn))))
(let* ((args (make-vector 10 nil))
(body (cdr (llama--collect (cons fn body) args)))
(rest (aref args 0))