Arc Forumnew | comments | leaders | submitlogin
3 points by zackman 6168 days ago | link | parent

Scheme's map doesn't handle improper lists, I guess. On line 167 of ac.scm, replace the following expression:

  (map (lambda (x) (ac-qq1 level x env)) x)
with

  (let loop ((x x) (acc '()))
    (cond ; inline map to handle improper lists
      ((null? x) (reverse acc)) ;properly terminated list
      ((pair? x) (loop (cdr x) (cons (ac-qq1 level (car x) env) acc)))
      (else (append (reverse acc) (ac-qq1 level x env)))))
I realise it looks stupid to write an inline map that handles improper lists. Is there a better way to do this?