[Bese-devel] Re: Proposal (was: [Lispweb] [ANN] UnCommon Web 0.2 - learning to walk)

Marco Baringer mb at bese.it
Tue Mar 2 18:17:14 UTC 2004


On Martedì, mar 2, 2004, at 17:52 Europe/Rome, rm at fabula.de wrote:

> Just a question: i'm currently using the yaclml:tal stuff from within 
> araneida.
> What do you think of making LOOKUP-TAL-VARIABLE a generic method 
> instead of a
> function? That way one could path all sorts of interesting things to 
> the tal renderer.
> Think of specialising lookup-tal-variable for uncommonsql queries that 
> return
> CLOS objects ...  one could do a TAL:DOLIST over a query result and 
> have a method
> that returns the slot values of CLOS object.

I think it's an excellent idea (sorta goes against the whole "code in 
one place presentation elswhere" idea, but I'm still deciding about 
that). However, we'd need to define a tal enviroment api, would this 
cover everything you need:

(defgeneric lookup-tal-variable (name enviroment)
   (:documentation "Return the value assciated with NAME (a
   symbol) in the enviroment ENVIROMENT."))

(defgeneric extend-tal-enviroment (new-env old-env)
   (:documentation "Create a new enviroment with all the bindings
   in both NEW-ENV and OLD-ENV. If both enviroments bind the same
   names the bindings in NEW-ENV must shadow those in OLD-ENV."))

(defgeneric add-binding (name value enviroment)
   (:documentation "Create a new enviroment which is like
   ENVIROMENT but also has VALUE bound to NAME."))

This should be enough to genericly implement DOLIST and INCLUDE which 
are, so far, the only tags i have which mess with the enviroment. It's 
been implemented in yaclml--dev--0.4--patch-5.

Makes me wonder if cacheable/lazy enviroments would be a good idea.

p.s. - Would it be dificult to write an araneida backend for ucw?

--
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