[Bese-devel] Re: Proposal (was: [Lispweb] [ANN] UnCommon Web 0.2 - learning to walk)
Marco Baringer
mb at bese.it
Wed Mar 3 13:22:46 UTC 2004
get yaclml--dev--0.4--patch-7 and you'll find the tal enviroment based
on three methods:
(defgeneric lookup-tal-variable (name enviroment)
(:documentation "Return the value assciated with NAME in the
enviroment ENVIROMENT."))
(defgeneric fetch-value (name binding)
(:documentation "Return the value associated with NAME in the
binding set BINDING."))
(defgeneric push-binding (binding enviroment)
(:documentation "Create a new enviroment with all the bindings
in BINDING. Any bindings in BINDING must shadow (on successive
calls to LOOKUP-TAL-VARIABLE) other bindings currently present
in ENVIROMENT."))
(defun make-standard-enviroment (&rest binding-sets)
"Given a list of binding-sets (BINDING-SETS) creates a new
standard TAL enviroment. The enviroment is created by,
conceptually, taking the elements of binding-sets in reverse
order and push-binding them onto an initially empty
enviroment.")
I removed add-binding since that's binding-set specific (for example
the binding-set based on objects doesn't even have it). I've included
an implementation of fetch-value for standard-objects, hash tables and
alists, which should cover most common uses.
Binding-sets in an enviroment can, and, in ucw at least, often are, be
of different types.
--
Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
More information about the bese-devel
mailing list