| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#11
| |||
| |||
| >>>>> "Ed" == Ed Prochak <edprochak@gmail.com> writes: Ed> On Jul 21, 1:20 am, paolo.bonz...@gmail.com wrote: >> > rather than saying something like >> >> > output := '<html><head>... </head><body> ... </body>' . >> >> > we can more simply say: >> >> > output := >> > [HTML >> > addComponent: [HEAD ... ] >> > addComponent: [BODY ... ] >> > ] >> >> this is more or less how you describe pages in seaside, actually. >> >> Paolo Ed> How are nested elements handled? Ed> <body>...<OL>...<LI>item <EM>one</EM>...</OL>...</body> html orderedList: [ html listItem: [ html text: 'item '. html emphasis: 'one'. ]. ]. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion |
|
#12
| |||
| |||
| OK, cool, I didn't know Seaside that well. I think what's noteworthy, since it's not immediately apparent from the code examples, is that these examples are LAZY EVALUATING. The inner block (is/can) be evaluated later - I believe, at least in my implementation, at the point in time when the block-structure needs to be accessed, because a request is made to render it as HTML etc. This may not sound as a big thing to begin with. But once you start playing with it you realize that at the point when a child-node-block is evaluated, it can take into account the current state of evaluation of the whole tree. This leads to all kinds of interesting possibilities including the fact that a child-node can have access to all its ancestor-nodes, and their properties, and can include conditional logic to create its own attributes based on the attributes of the containers. I think in the end this will blow the socks off any static markup languages, such as HTML, XML etc. And what's most noteworthy is that Smalltalk (+ some other minor languages like Lisp) have the syntax to support it already. Whatever XML is good for, Smalltalk is as good and better, it seems. -Panu Viljamaa Randal L. Schwartz wrote: >>>>>> "Ed" == Ed Prochak <edprochak@gmail.com> writes: > > Ed> On Jul 21, 1:20 am, paolo.bonz...@gmail.com wrote: >>>> rather than saying something like >>>> output := '<html><head>... </head><body> ... </body>' . >>>> we can more simply say: >>>> output := >>>> [HTML >>>> addComponent: [HEAD ... ] >>>> addComponent: [BODY ... ] >>>> ] >>> this is more or less how you describe pages in seaside, actually. >>> >>> Paolo > > Ed> How are nested elements handled? > Ed> <body>...<OL>...<LI>item <EM>one</EM>...</OL>...</body> > > html orderedList: [ > html listItem: [ > html text: 'item '. > html emphasis: 'one'. > ]. > ]. > |
|
#13
| |||
| |||
| "Panu" <panu@nospam.com> wrote in message news:k4qdnTjmB77YdQrVnZ2dnUVZ_sWdnZ2d@totallyobjec ts.com... > Whatever XML is good for, Smalltalk > is as good and better, it seems. How's about that for an example of "damning with faint praise"! :-) Steve |
|
#14
| |||
| |||
| Randal L. Schwartz wrote: >>>>>> "Ed" == Ed Prochak <edprochak@gmail.com> writes: > > Ed> On Jul 21, 1:20 am, paolo.bonz...@gmail.com wrote: >>>> rather than saying something like >>>> output := '<html><head>... </head><body> ... </body>' . >>>> we can more simply say: >>>> output := >>>> [HTML >>>> addComponent: [HEAD ... ] >>>> addComponent: [BODY ... ] >>>> ] >>> this is more or less how you describe pages in seaside, actually. >>> >>> Paolo > > Ed> How are nested elements handled? > Ed> <body>...<OL>...<LI>item <EM>one</EM>...</OL>...</body> > > html orderedList: [ > html listItem: [ > html text: 'item '. > html emphasis: 'one'. > ]. > ]. Question... Why wouldn't you just use a templating mechanism instead of hand coded psuedo-HTML? I would rather write my HTML in HTML: <ol> <li>${item} <em>${description}</em></li> </ol> template apply: data Mike Austin |
|
#15
| |||
| |||
| >> >> html orderedList: [ >> html listItem: [ >> html text: 'item '. >> html emphasis: 'one'. >> ]. >> ]. > > Question... > > Why wouldn't you just use a templating mechanism instead of hand coded > psuedo-HTML? I would rather write my HTML in HTML: > > <ol> > <li>${item} <em>${description}</em></li> > </ol> > > template apply: data Been there, done that -- it's a nightmare. It mostly boils down to templates being 'dead code', you cannot do 'senders of' or 'references to variable' etc -- it makes development slower. Hard coding the html generation but leaving the RSS free to be tweaked by a design department appears to give a much more productive responsibility split. If you are not aware of the various 'heretical' Seaside design decisions you may want to read some of the interviews Avi gave, like this one: http://www.caboo.se/articles/2007/4/...ith-avi-bryant R - |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.