[Zope] <% ... %> ?

Robin Becker robin@jessikat.demon.co.uk
Fri, 11 Jun 1999 17:51:03 +0100


In article <4.1.19990611111756.00a14c60@jules.com>, Jules Allen
<zope@jules.com> writes
>Has it been suggested that the SSI-type syntax of Zope isn't the most
>readable thing in the world? Is this even the right list to suggest this
>heresy or should I strap on the asbestos underwear and wander over to zopedev?
>
>I've used a bunch of Web-apps such Cold Fusion, PHP, ASP, etc., and the
>ones that have the cleanest organization to me seem to allow code blocks
>rather than single statements. So, to me, PHP and ASP are easier to
>maintain than Cold Fusion.
>
>Doesn't something like this
>
>- - - Cut Here - - -
>
><%
>call "REQUEST.set('thistitle', title_or_id())"
>in "PARENTS[0].objectValues(['DTML Document', 'Folder'])"
>  if "_.has_key('IsPublic') and IsPublic"
>    if "thistitle == title_or_id()" %>
>      <img src="/Images/activedoc.gif" width="8"
>        height="8"><b><% var title_or_id %></b><br>
>    <% else %>
>      <img src="/Images/spacer.gif" width="8" height="8"><a
>        href="<% var id url_quote %>"><% var title_or_id %></a><br>
>    <% /if
>  /if
>/in %>
>
>- - - Cut Here - - -
>
>seem easier to read than this?
here here; the current zope dtml syntax is really a nightmare. I would
be even more extreme and as has been suggested elsewhere would use some
open and close delimiters to contain arbitrary python. Conceptually this
is already provided for with call, var etc + an external function.
I really like the tclHTTPD syntax in which every active bit is supposed
to return a piece of text (possibly empty). The chosen delimiters '[' &
']' are there for tcl's convenience, but the same idea could be easily
applied to '<--#' '-->' 
>- - - Cut Here - - -
>
><!--#call "REQUEST.set('thistitle', title_or_id())"-->
><!--#in "PARENTS[0].objectValues(['DTML Document', 'Folder'])"-->
>  <!--#if "_.has_key('IsPublic') and IsPublic"-->
>    <!--#if "thistitle == title_or_id()"-->
>      <img src="/Images/activedoc.gif" width="8"
>        height="8"><b><!--#var title_or_id--></b><br>
>    <!--#else-->
>      <img src="/Images/spacer.gif" width="8" height="8"><a
>        href="<!--#var id url_quote-->"><!--#var title_or_id--></a><br>
>    <!--#/if-->
>  <!--#/if-->
><!--#/in-->
>
>- - - Cut Here - - -
>
>Yeah, easy for me to say "oh just go rewite the parser" and then walk away...
>
>Just a thought.
>
>--
>Codito, ergo sum.
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://www.zope.org/mailman/listinfo/zope
>
>(For developer-specific issues, use the companion list,
>zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )

-- 
Robin Becker