[Bese-devel] Re: looking for advice: mixing applications and other content

Marco Baringer mb at bese.it
Thu Feb 2 14:03:56 UTC 2006


Jan Rychter wrote:
> Ahem, the parameter passing doesn't seem to work for me. I've
> defined
> 
>   (deftalpage "example2.ucw" (title) "example.tal")
> 
> and example.tal contains (among other lines):
> 
>   <title tal:content="$title">TITLE</title>
> 
> accessing http://localhost/example2.ucw?title=23 gives me
> 
> There is no applicable method for the generic function
>   #<STANDARD-GENERIC-FUNCTION IT.BESE.YACLML::FETCH-VALUE (3)>
> when called with arguments
>   (JWR-WEB::TITLE "23").
>    [Condition of type SIMPLE-ERROR]


the template-environment method should be: (this is still untested)

(defmethod template-component-environment nconc
    ((template ,(intern url :my-package)))
  `(make-standard-environment
     (list ,@(mapcar (lambda (argument)
                       `(cons ',argument ,argument))
                     (mapcar (lambda (arg-spec)
                               (if (consp arg-spec)
                                   (first arg-spec)
                                   arg-spec))
                             args)))))

basically if the args are foo, bar, goo we want the tal env to be and
alist like:

(list (cons 'foo foo)
      (cons 'bar bar)
      (cons 'goo goo))

the construction of this form is a little messy when dealing with
default vales for parameters.

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