[Bese-devel] <ucw:a

Jan Rychter jan at rychter.com
Wed Nov 2 20:12:36 UTC 2005


Marco:
> Jan Rychter <jan at rychter.com> writes:
> > So, can I generate (<ucw:a :action (myaction p)) links inside looping
> > constructs with p bound successively to various values? If so, which
> > looping constructs are supposed to work?
> 
> any looping construct which creates a fresh binding on each iteration
> (since P is a closed over variable successive loops which change the
> value of p will change it for all the links generated).

Ah, ok. That explains it. It also explains why all my actions would get
the latest value in a loop.

> this basically means that the only constructs whcih are guaranteed to
> work are:
> 
> 1) dolist* 
> 
> 2) a regural loop or doWHATEVER with the action wrapped like this:
> 
> (dolist (p list)
>   ...
>   (let ((p p))
>     (<ucw:a :action (myaction p))))

This trick certainly beats the technique I used: pre-generating all
action links to strings using mapcar and inserting them as strings in
complex loops afterwards. :)

> now that i think about it we have a complete code-walker avalibale
> which could esaily (fsvo "easily") figure out the free variables in an
> action form and wrap them in the let....

That would be very, very welcome.

> > I seem to be having problems with everything except dolist.
> 
> are you sure you didn't mean dolist*?

No, dolist actually seemed to work for me (why?). I had trouble with do
and do*, as well as various iterate forms.

--J.



More information about the bese-devel mailing list