"Daniel L. Rall" wrote:
>
> "Geir Magnusson Jr." wrote:
> > [snip]
> > > > 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.
>
> Your macro would be called as a directive because of the '#' in front of
> it.
Yes, in the syntax from the view of the designer, I guess it would be.
On the implementation side, a preprocessing step would be included which
expands the macros out before being actually processed, which are
written using the 'regular' directives of the language, so the piece
that processes the directives wouldn't see anything new.
<aside>
My language formalism is weak : is it true that in the following C
program
#define FOO(x) x=x*2
main()
{
int x = 1;
if (x)
FOO(x);
}
both 'if' and 'FOO' are considered directives? If not, why would they
both be in my example above?
</aside>
> [snip]
> > 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.
>
> Unfortunately, I haven't seen this work all that well in practice. The
> art major that you just hired straight out of college should focus on
> the look and feel of your web site, not on climbing the learning curve
> of how to call Velocimacros. I would prefer not to reinvent PHP or ASP
> style development, and adding Velocimacros would allow this, regardless
> of original intent and usefullness to the uber-designer.
So the art major then sets up look and feel thing, and that is captured
and formalized into Velocimacros, so his/her art minions can code the
content templates. Then, when fashion changes, you can modify the
velocimacros for a wholesale change.
So the art major does what then to address the issue in the current
implementation?
Solution 1 : <input type=text name=email value="$email">
which would spew crap into your textbox under webmacro if $email was
undefined
Solution 2 : <input type=text name=email value=$!email>
because the ! modifier was added, so this is ok, but it has been argued
that is
too perl-like and hard for that art major to remember (or something...)
Solution 3 : <input type=text name=email value="
#if ($email) {
$email
}
">
which has all sorts of problems, including ugliness and having to
repeat the if
construct in multiple places
Solution 4 :
#if ($email) {
<input type=text name=email value="$email">
}
#else {
<input type=text name=email value="">
}
tedious in practice...
or a velocimacro.
I guess if this doesn't happen, one can always write a template
preprocessor to do exactly this (expand macros into velocicode) but that
seems to be one of the purposes of a template engine anyway.
geir
> --
>
> Daniel Rall <[EMAIL PROTECTED]>
--
Geir Magnusson Jr.
[EMAIL PROTECTED]