As I understand "is" for lists compares pointers not elements. So: arc> (= a (list 'cons))
(cons)
arc> (= b (list 'cons))
(cons)
arc> (is a b)
nil
Implementation of hash doesn't seem to use "is", because it wouldn't be possible to assess the elements at all by list as a key.
In fact happens something I don't understand: arc> (= vtable (table))
#hash()
arc> (= (vtable (list (type '(1)))) 'a-method)
a-method
arc> (vtable '(cons))
nil
arc> (vtable (list 'cons))
a-method
arc> (quote (cons))
(cons)
arc> (list 'cons)
(cons)
Why can't I use '(cons) to access a-method and why is it still possible to access it by (list 'cons)? |