Arc Forumnew | comments | leaders | submitlogin
4 points by pg 6157 days ago | link | parent

The problem may be the space after the @.


5 points by cadaver 6157 days ago | link

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

-----

2 points by mec 6156 days ago | link

The space was a typo when writing the post, not in the code.

-----