Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backquote bug #492

Open
hemml opened this issue Apr 25, 2024 · 4 comments
Open

Backquote bug #492

hemml opened this issue Apr 25, 2024 · 4 comments
Labels

Comments

@hemml
Copy link
Contributor

hemml commented Apr 25, 2024

CL-USER> `(1 . 2)
ERROR: CAR called on non-list argument
CL-USER> '(1 . 2)
(1 . 2)
@hemml
Copy link
Contributor Author

hemml commented Apr 25, 2024

Sorry for update, occasionally hit enter)

@davazp davazp added the bug label Apr 25, 2024
@SuperDisk
Copy link

SuperDisk commented Apr 29, 2024

Changing bq-attach-append in backquote.lisp to this seems to fix it:

(defun bq-attach-append (op item result)
  (cond ((and (null-or-quoted item) (null-or-quoted result))
         (if (atom (cadr item))
             (list *bq-quote* (cadr item))
             (list *bq-quote* (append (cadr item) (cadr result)))))
        ((or (null result) (equal result *bq-quote-nil*))
         (if (bq-splicing-frob item) (list op item) item))
        ((and (consp result) (eq (car result) op))
         (list* (car result) item (cdr result)))
        (t (list op item result))))

@davazp
Copy link
Member

davazp commented Apr 29, 2024

@SuperDisk nice, would you mind opening a PR for it? then we can make sure it passes tests and see the diff.

@SuperDisk
Copy link

Done, although I'm not 100% confident it's the right way to implement the fix. This project looks really cool by the way, I'd be really interested in hacking more on it if I get some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants