On 2012-09-13 17:36, Damon Courtney wrote:
Is this documented somewhere? I poked around the docs a bit (which
are hideous, by the way) and couldn't find it mentioned. In fact,
other than our examples, I found only a single mention anywhere that
<? ?> was how you actually GET Rivet code into a webpage.
In using the source (Luke), it looks as though the <?= ?> construct
is meant to be used as:
<?= $some_variable ?>
and that's about it.
Yes, it's a shorthand notation for simple output of a single string.
If the parser sees = as the first character of
the string, it append 'puts -nonewline' and then the rest of the
string. So, it looks like the = is only good for a single variable
or
value there since no effort is made to output or close a quote. In
other words:
<?= $foo $bar ?>
is going to blow up without doing:
<?= "$foo $bar" ?>
We either need to decide to upgrade this construct to quote the
value, or we really need to document this behavior. Actually, we
need
to document the behavior either way, but I think the single value
thing could be better. Although it will make the code a little more
complicated. The current code is quite small and simple, so there's
a
vote for that.
I think the construct supporting a single value is cleaner because if
forces the programmer to delimit explicitly the output. In the implicit
list form you would have some ambiguity about the spaces preceding,
separating and trailing the list of variables (we could give it a sense
anyway, but I don't see the plus)
-- Massimo
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org