>there are Haml implementations for [...] even Erlang
   No way! Cool!  Now all we need is one for Scheme, although those
folks will probably say that s-exps are all you'd ever need. ;)

Since HAML's got cross-platform/-language covered, it sounds like
sphaml's niche is in minimalism and extra-terse syntax.  So, back to
that point, with the email I didn't get around to sending yesterday:

(Good counter-points, Steve.)  The only thing that really stumps me
about the pipe syntax is how to notate an empty tag.  For a little
less contrived example, let's say I'm printing out rows from a
database:

table
<% foreach row in table: %>
  tr
    td | <%=row.required%>
    td | <%=row.optional%>
<% end %>

What happens when row.optional==""? Don't you get:
table
  tr
    td | req1
    td |
  tr
    td | req2
    td | opt2

and wouldn't that generate:
<table>
  <tr>
    <td>req1</td>
    td |
  </tr>
  <tr>
    <td>req2</td>
    <td>opt2</td>
  </tr>
</table>

which shows up in the browser as:
td |
req1
req2    opt2


> The main rationale for [no scripting language sugar] is simplicity and 
> versatility, so that it can work with other templating languages.

   Could the previously-mentioned HAML way of escaping code (-,=) be
exposed in a language-independent way? As in, the user specifies
somewhere (either as an argument/config to sphaml, or at the top of
their source file) how "tag=some_code" should expand?  Wouldn't it
always be like:
  <tag> START_CODE some_code STOP_CODE </tag>
where START_CODE and STOP_CODE are defined like:
case $language:
  "ruby":
    START_CODE="<%="
    STOP_CODE="%>"
  "php":
    START_CODE="<? echo "
    STOP_CODE="?>"
  ...

PS. It's nice n' easy how all the code is in one <4 page file.

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" 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/haml?hl=en.

Reply via email to