Arc Forumnew | comments | leaders | submitlogin
5 points by cadaver 6120 days ago | link | parent

The '(frst . rest)' signals an error before compilation reaches the ,@.

The problem is, I think, that ac-qq1 doesn't expect to encounter an improper list. So, with arc1 you can't use a dot in a quasiquote to denote an improper list.

However, as vsingh pointed out, an unescaped cons operation will get you an improper list in a quasiquote where a dot doesn't.

This seems like a bug indeed, and it is easy to fix, simply replace this in ac-qq1:

  ((pair? x)
   (map (lambda (x) (ac-qq1 level x env)) x)))
with this:

  ((pair? x)
   (cons (ac-qq1 level (car x) env) (ac-qq1 level (cdr x) env)))


1 point by mec 6119 days ago | link

Very nice fix, with that I can finally do

  (define (read-square-brackets ch port src line col pos)
    `(fn (_ . __)
       ,(read/recursive port #\[ #f)))

-----