HV intro (was Re: Squeak SSP-- huh?)

Avi Bryant avi at beta4.com
Thu Apr 4 19:08:47 UTC 2002


On Thu, 4 Apr 2002 goran.hultgren at bluefish.se wrote:

> PS. How does Seaside integrate with Squeak? Can you edit the pages in a
> browser like SSP does? Can you do "senders of" etc? I guess that those
> things would be the weaknesses of Seaside compared to HV - if there are
> any. :-) DS

Yes, you can edit the pages in the browser - since the templates are pure
text, it's pretty easy to just have an #html method that returns a string
literal.  You have to double your ' quotes, of course, but that's not
often an issue.  If you specify an external html file instead, it'll watch
for the file to change and reload it as needed.

As for 'senders of', etc, remember that most of your code in a Seaside app
is straight smalltalk - all of the logic and control flow is kept totally
separate from the template, and is in all the other (non-#html) methods of
the components.  The example I gave you before was simple enough not to
need any other logic, but that's hardly the usual case.  So 'senders of',
etc, work fine for all that.  If you really want to be able to treat the
template as code, you can use a lispy array/symbol literal syntax for your
html - so instead of

html
  ^ '<html><h1>foo</h1><form sea:id="reload">...</form></html>'

you use

html
  ^ #(html (h1 'foo') (form sea:id: reload '...'))

The "thorough senders of" preference will pick up the symbols in this
literal.

Obviously this only works for prototyping, since you lose the easy
interoperation with HTML tools.

Cheers,
Avi




More information about the Squeak-dev mailing list