Stephen Compall <[email protected]> writes: > Jan Rychter <[email protected]> writes: >>> Benjamin Collins <[email protected]> writes: >>>> (lambda () >>>> (let ((tw (make-instance 'toggle-widget :showp t >>>> :data "Test data.")))))))) >>> >>> This is a widget that does not render anything. Strip it down to the >>> make-instance. >> >> I have been thinking along similar lines -- I considered making all >> widgets be widgets and instead provide a (widget "abcd") function that >> would create a widget based on a string or a function. >> >> It would really simplify a lot of things, remove ensure-widget-methods >> that is so scary I'm afraid to even look at it, and make testing >> easier. > > Setting aside implementation simplicity, would writing (widget (lambda > ...)) above instead of just (lambda ...) have helped Benjamin or Robin > Lee Powell¹ avoid the mistake they made? > > ¹ > http://groups.google.com/group/weblocks/browse_thread/thread/69d61bec408c8638
I don't think so. Rather, we should point out that function widgets (lambda widgets) are really just a plain render function that gets called on every render. Just like a string gets displayed on every render. In general, I think what confuses people (myself included back when I was first looking at weblocks) was that there are two distinct concepts: one is building/modifying the tree and the other is rendering. It does not help that these two are conflated in the demo examples, with flows mixed in for good measure. Once I get through the stuff that really needs doing, I hope to be able to think of a better (simpler?) example of how to use weblocks. --J. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
