>
>Ok. I realize that this is an architectural/design decision, but my gut
>feeling is that it's counter-intuitive to the average programmer. Here's
>why: The Embperl model is fundamentally about dynamically creating HTML.
>This obviously means conditional code and loops. A programmer does not
>intuitively expect *conditional* HTML code to "count" in a syntactic
>sense before it is actually executed. For example, you may have several
>conditionals inside a loop, each of which contains some kind of HTML
>fragment. Each of these conditional fragments may contain repeated
>instances of the same HTML fragment, in a slightly different format. Any
>interesting (i.e. non-trivial) code will have this kind of thing. Why
>should each case of conditional HTML which contains (e.g.) a <UL> or
></UL> tag be counted in the HTML syntax checking, even though it's not
>actually included in the final page? This kinda negates the whole
>convenience of having conditional code.
>


What Embperl does is _not_ a syntax check of your html. I only checks the
syntax so far as it is necessary to generate code. So as long as you use
tags that aren't interpreted by Embperl (e.g. the <TD> tag), it doesn't
matter, but all tags that may generate a dynamic table/list creates trouble,
because Embperl 2.0 actualy creates a Perl loop out of it, so will have
something like:

if (foo)
    {
    for (bar)
        {
    }

if (xxx)
    {
        } # this is the end of the for loop
    }

This Perl code actualy can't work.
So while you can have different condtional block inside the loop (of course
you can have, otherwise we wound't need Embperl), the current implementation
requires that the start and the end of a dynamic/table list, are in the same
conditionaly block.

The problem would be obvious, if that code really generates dynamic tables,
but often they are simple static tables, so there is no need for the for
loop in the above example. My goal is, to make Embperl smart enought to
recognize this fact and don't create the for loop, so we don't have a
problem.

I hope it's now a little clearer why the currently Embperl requires correct
nesting of certain tags.

Gerald



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to