<br>The same happened to me but with the iterate macro. I think it was because of the cps transformation; there's something written about it somewhere. Stick to mapcar o similar functions and you'll be ok.<br><br>Cheers<br>
<br>Mariano<br><br><div class="gmail_quote">On Sat, May 23, 2009 at 3:41 AM, Fausto Santin <span dir="ltr"><<a href="mailto:fawxtin@gmail.com">fawxtin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br>
<br>
Im updating things from ucw_dev to ucw-core, and simply got 1 hours<br>
with a little bug bothering me. Right when I was suposed to send a help<br>
note (this email), I found a solution to the probable bug, but Im<br>
still sending<br>
this email to see/know why, and where things happened wrong.<br>
<br>
The context: I am updating a simple blog like app, and the main render<br>
method (that renders the list of posts) is no good at "passing actions".<br>
<br>
;; DO NOT work ok<br>
(defmethod render-html-body ((self lisdit))<br>
(<:p (<ucw:a :action (add-post self) "new post"))<br>
(loop :for post :in (lisdit-posts self)<br>
:do<br>
(<:div :id "lisdit-post"<br>
(render post)<br>
"post: " (<:as-html (lisdit-post-id post))<br>
(<ucw:a :action (remove-post (lisdit-post-id post) self) "remove<br>
it")))) ; XXX here<br>
<br>
Every time I use the above definition, Im getting unexpected behavior<br>
on the remove-post<br>
action. Whenever remove link I click, it simply removes the most old<br>
item on the list. But when<br>
I use mapcar, instead of the loop macro, Im getting what I expect,<br>
the remove link I click<br>
corresponds to the expected item.<br>
<br>
;; works OK<br>
(defmethod render-html-body ((self lisdit))<br>
(<:p (<ucw:a :action (add-post self) "new post"))<br>
(mapcar #'(lambda (post)<br>
(<:div :id "lisdit-post"<br>
(render post)<br>
"post: " (<:as-html (lisdit-post-id post))<br>
(<ucw:a :action (remove-post (lisdit-post-id post) self)<br>
"remove it")))<br>
(lisdit-posts self)))<br>
<br>
Any idea why this happen?<br>
<font color="#888888"><br>
--<br>
Fausto LS<br>
<br>
_______________________________________________<br>
bese-devel mailing list<br>
<a href="mailto:bese-devel@common-lisp.net">bese-devel@common-lisp.net</a><br>
<a href="http://common-lisp.net/cgi-bin/mailman/listinfo/bese-devel" target="_blank">http://common-lisp.net/cgi-bin/mailman/listinfo/bese-devel</a><br>
</font></blockquote></div><br>