Jon Stevens wrote:
> 
> on 9/24/2000 1:16 PM, "Geir Magnusson Jr." <[EMAIL PROTECTED]> wrote:
> 
> > True.  Hoping not to wade back into the format-layer debate I watched go
> > by, nor rekindle the multiple-syntax idea, how about a preprocessor-like
> > facility so we can build things like this w/o making the language
> > bigger.  For example :
> >
> > <input type="text" name="email" value="#isNull($email, "")">
> >
> > where
> >
> > isNull(x,y) := #if (x) { x } #else { y }
> <snip>
> 
> There is a difference in my mind between directives (#) and variables ($).
> For simplicity, I really want to keep the number of directives to as few as
> possible because I relate directives to functions. I would however agree
> that we should provide a number of tools to go into the context (ie: like
> WM's ContextTools).
> 

But we don't add any directives to the language here.  I agree with you
that the core language should remain small.  Real small.


> The more that I think about it, the more I'm -1 on $!foo. The reason is that
> it makes us start to look like Perl syntax where you have all sorts of
> "modifiers" on variables and that gets confusing for people very quickly.

Agreed.
 
> So, to take your proposal one step further:
> 
> <input type="text" name="email" value="$tool.Value($email, "")">
> 
> That seems perfectly acceptable and is a valid way right now to solve the
> problem without any core language changes.

But when using a template engine, you are basically providing a small
set of programming facilities for the designer to use.  Adding a macro
capability doesn't change this : you are simply allowing the
diabolically creative to avoid using constructs like

        #set $title="the title"
        #set $title_color="red"
        #parse "/<directory>/title_show_template.wm

Where title_show_template.wm simply contains 

        <center>
        <b><font color=$title_color>$title</font></b>
        </center>

which to me is not only an horrendous abomination from a design point of
view, it's much harder to read than

        #showSmallTitle( "the title", "red")

where 

        showSmallTitle(x,y) := <center><b><font color=y>x</font></b></center>

I mean, if it was argued that adding multiple syntaxes to the language
was important to support special tasks and repetitive tasks, here is a
way of doing it w/o adding complexity to the engine.

Further, this allows an uber-designer to create tools for a design group
to use to maintain consistancy in look/feel/design.

geir


-- 
Geir Magnusson Jr.
[EMAIL PROTECTED]

Reply via email to