Quoting Ray Cromwell ([EMAIL PROTECTED]):
> Justin, you completely miss the point. I don't care if WebMacro only
> had 2 primitives in its language. Lisp/Scheme are also so simple, you
> can fit the entire language spec on a single page. Lisp-like languages
> are utterly simple to learn, but take a lifetime to master.
Here's an example using five of them:
#parse "header.wm"
#set $list = [ "apple", "orange", "banana" ]
#foreach $thing in $list {
#if ($thing == "orange") {
$thing is a citrus fruit
} #else {
$thing tastes good
}
}
#include "footer.html"
So Ray, what is there to "master" here? What is so complex that you
would need to be a lisp/scheme programmer to understand? There is
nothing more complex than this in the WM script language.
If you need more complex stuff, you write it in Java either in your
servlet, or in a bean that you drop into your context.
> You focus 100% of your attention on the business logic, and totally
> overlook the problem of designing and maintaining all the views,
> which are also non-trivial. Large scale view architecture, even
> with a simple substitution language is still non-trivial.
In WM your controller, the servlet, processes the input from the
web user and decides which views to use. Rather than implementing
complex view selection logic in the WM template (which would be ugly)
you do it in the controlling servlet like this:
Template t = /* pick your template however you like */
return t;
Also you claim this:
> WebMacro utterly lacks anything to promote view reuse, or code
> parameterization.
What's wrong with this:
#parse $header
How is that not re-using views, or not parameterized? Where the
value of the $header variable comes from is up to you. You could
have defined it earlier in the template; you could have defined
it in the servlet; you could have written a context tool that
implements complex selection logic in Java.
> Maybe in the future, you will add macros and the
> ability to use "macro libraries" (so WebMacro can be competetive with
> 1993 technology) which can be a repository of knowledge that the view
> coders can build upon over and over, but right now, you're stuck with
> #parse and cut-and-paste.
WebMacro already supports Macros, you just can't define them in
WebMacro. You have to write them in Java. It's supported them from
day one.
Initially the #macro directive (defining a macro in WM) was going
to be one of the most important and coolest features in WM. Or so
I thought. I developed WM in response to real world demands both
from my users, and from my own uses of it. Nobody ever asked me
to implement the #macro directive, and I never needed it.
It's one of those really powerful, really cool features that turns
out not to be needed in 99% of real world applications, despite how
cool it might be.
WebMacro has been implemented to be useful, rather than cool.
> However, since you can't pass parameters
I showed you how to pass parameters above. It's very simple: you
use a variable.
> Anyway, let's not even talk about WebMacro's total lack of even basic arithmetic
> expressions. I suppose your theory is that, if I need to add "1" to a number,
Just do this:
#set number = $math.sqrt(32)
and drop an appropriate math object into your toolkit. WebMacro provides
you with a mechanism to make any tool you like automatically available
across all your templates.
> I should delegate that to that poor overloaded Java servlet right?
Nope, you should drop that into your context as an extension. You get
to register all the ContextTools you like in your WebMacro.properties
file.
.....
And so it goes, I don't have time to go on with this. I've only responded
to a few key misconceptions.
> I've already tried it, and looked at the source code. That's why I feel
> confident in criticizing it.
Apparently you are a little over-confident ;-)
I realize this is the JSP list, but contrary to your flamebait, I
didn't start this thread, and more or less I've stuck to correcting
things people said that I didn't think were true.
Since I don't intend this thread to go on forever, I suggest you
respond to me privately, or we move this thread to the WM list, or
at the very least, the servlet list.
Justin
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html