Contents    Page-10    Prev    Next    Page+10    Index   

Binding Lists

A binding is a correspondence of a name and a value.

A set of bindings is represented as a list, called an association list, or alist for short. A new binding can be added by:
(push (list name value ) binding-list )

A name can be looked up using assoc:
(assoc name binding-list )


(assoc '?y '((?x 3) (?y 4) (?z 5)))
   =  (?Y 4)
The value of the binding can be gotten using second:

(second (assoc '?y '((?x 3) (?y 4) (?z 5))))
   =  4