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

    Address ##'s identity crisis
    
    When the file was evaluated, the previous code worked, but when the
    compiled file is loaded instead, then (eq '## X) where X's value is
    a "runtime '##", returns nil.
---
 llama-test.el | 8 ++++++++
 llama.el      | 8 ++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/llama-test.el b/llama-test.el
index 79cbabffd7..6eed5ca147 100644
--- a/llama-test.el
+++ b/llama-test.el
@@ -98,6 +98,14 @@
                    (list  %1           &2       &*))))
   )
 
+(ert-deftest llama-test-104-basic-nested nil
+
+  (should (equal (##list (##list %) %1)
+                 (lambda (%1)
+                   (list (lambda (%) (list %))
+                         %1))))
+  )
+
 (ert-deftest llama-test-201-unused-implicit-mandatory nil
 
   (should (equal (##list      %2)
diff --git a/llama.el b/llama.el
index 27bf743954..a1868085b4 100644
--- a/llama.el
+++ b/llama.el
@@ -178,14 +178,14 @@ to view this docstring.)"
         ,@(and rest (list '&rest rest)))
        (,fn ,@body))))
 
-(defalias (quote ##) 'llama)
-(defalias (quote \#\#) 'llama)
+(defalias (intern "") 'llama)
+(defalias '\#\# 'llama)
 
 (defconst llama--unused-argument (make-symbol "llama--unused-argument"))
 
 (defun llama--collect (expr args &optional fnpos backquoted)
   (cond
-   ((memq (car-safe expr) '(## llama quote)) expr)
+   ((memq (car-safe expr) (list (intern "") 'llama 'quote)) expr)
    ((and backquoted (symbolp expr)) expr)
    ((and backquoted (eq (car-safe expr) backquote-unquote-symbol))
     (cons backquote-unquote-symbol
@@ -395,7 +395,7 @@ expansion, and the looks of this face should hint at that.")
   (cond
    ((eq (car-safe expr) 'quote))
    ((eq (ignore-errors (bare-symbol (car-safe expr))) 'quote))
-   ((and (memq (car-safe expr) '(## llama)) (not top)))
+   ((and (memq (car-safe expr) (list (intern "") 'llama)) (not top)))
    ((and backquoted (symbol-with-pos-p expr)))
    ((and backquoted (eq (car-safe expr) backquote-unquote-symbol))
     (llama--fontify expr))

Reply via email to