Arc Forumnew | comments | leaders | submitlogin
5 points by dido 6299 days ago | link | parent

arc> (iso nil ())

t

arc> (iso nil '())

t

arc> (iso () '())

t

How are they not supposed to be equivalent?



4 points by sacado 6299 days ago | link

from ac.scm :

  ; rather strictly excludes ()
  (define (arc-list? x) (or (pair? x) (eqv? x 'nil)))

  ; generic +: strings, lists, numbers.
  (xdef '+ (lambda args
           (cond ((null? args) 0)
                 ((all string? args)
                  (apply string-append args))
                 ((all arc-list? args)
                  (ac-niltree (apply append (map ar-nil-terminate args))))
                 (#t (apply + args)))))
Obviously, () is not an arc-list (as defined above). Thus, the test (all arc-list? args) fails with (+ '(a b c) ()) : finally, (apply + args), which is the numerical + of scheme is applied, hence the error message.

You were right, this might be a bug...

-----