Hello, I am currently trying out weblocks-stable and trying to get a
grip of weblocks behavior with continuations, do-page and friends.
The following piece of code simply creates a flash widget, and a link
which displays a page where one can choose between to "answers" which
cause the flash widget to change its contents
The first version below works as expected
The second version does not, what am i missing? Is there a break in
the continuation passing chain somewhere? Do function widgets behave
in a special way?
Version 1:
;;explicit version
;;behaviour: as expected
(defun make-documents-page()
(let ((docflash (make-instance 'flash :messages (list "flash!"))))
(make-instance 'widget :children
(list
docflash
(lambda()
(render-link (lambda/cc(&rest args)
(declare (ignorable args))
(flash-message docflash
(do-page
(let ((rw
(make-instance 'widget)))
(setf
(widget-children rw)
(list
(f_%
(render-link
(f_% (answer rw "yes")) "you bet!"))
(f_%
(render-link
(f_% (answer rw "no")) "never ever!"))))
rw))))
"start the test dialog"))))))
Version 2:
;;with function
;;behaviour: stuck with empty page, containing one empty function
widget
(defun make-documents-page()
(let ((docflash (make-instance 'flash :messages (list "flash!"))))
(make-instance 'widget :children
(list
docflash
(lambda()
(render-link (lambda/cc(&rest args)
(declare (ignorable args))
(flash-message docflash
(do-page #'testpage1)))
"start the test dialog"))))))
(defun/cc testpage1(k)
(make-instance 'widget :children
(list (f_% (render-link (f_% (answer k "yes")) "you bet!"))
(f_% (render-link (f_% (answer k "no")) "never
ever!")))))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---