jscl icon indicating copy to clipboard operation
jscl copied to clipboard

Backquote bug

Open hemml opened this issue 1 year ago • 4 comments

CL-USER> `(1 . 2)
ERROR: CAR called on non-list argument
CL-USER> '(1 . 2)
(1 . 2)

hemml avatar Apr 25 '24 14:04 hemml

Sorry for update, occasionally hit enter)

hemml avatar Apr 25 '24 14:04 hemml

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))))

SuperDisk avatar Apr 29 '24 13:04 SuperDisk

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

davazp avatar Apr 29 '24 15:04 davazp

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.

SuperDisk avatar Apr 29 '24 18:04 SuperDisk