You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Tim Colson <tc...@cisco.com> on 2003/07/01 18:31:48 UTC

Can comparisons be limited to true/false?

Howdy folks -
  I'm wondering how I might limit the comparisons in velocity templates
to only boolean conditions.

For example:
#if ($value > 20) HIGHLIGHTED BUTTON #else stdbutton #end
would throw an exception and would need to be written with
a context containing "IS_OVER_LIMIT", new Boolean() and this template:
#if ($IS_OVER_LIMIT) HIGHLIGHTED BUTTON #else stdbutton #end

Another example:
#if ($widget.size == "LARGE")  large #else not large #end
would throw an exception and would need to be written as:
#if ($widget.size.isLarge())  large #else not large #end

The question here is academic at this point. I do not care to argue
about why this might be good/bad/weird, nor do I want to hear how it
could be done in another engine. 

I'm just curious to know how one might go about messing with Velocity to
alter it's behaviour as described. Maybe I'll learn something in the
process of looking. :-)

Thanks!
Timo


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Can comparisons be limited to true/false?

Posted by Will Glass-Husain <wg...@forio.com>.
Hi Tim,

Here's a link to JavaCC.
http://javacc.dev.java.net/

I just learned how to modify the core language syntax recently.  Here's a
quick set of steps.  Maybe one of us should write a "how-to" for new
Velocity developers.

(1) Modify "Parser.jjt" to change the syntax of the language
(2) Use jjtree (part of javacc) to compile to Parser.jj.  This will also
generate a lot of "Node" java files which you should delete
(3) Use javacc to compile "Parser.jj" to "Parser.java".
(4) Edit the Node java files in the Nodes subdirectory to change evaluated
behavior.
(5) Compile, build the jar as usual

JJTree is a pre-processor that generates java code which stores a tree of
parsed syntax.  All the Node files in the Nodes subdirectory were once
generated by JJTree, but have since been modified and moved into the Node
directory (to prevent them from being overwritten in step 2).   If you
extend the language and create a new syntactical expression which requires a
new node, you should copy that generated Node file into the Nodes
subdirectory.

So, in reference to my earlier email, you will change the if statment syntax
in "Parser.jjt" to only allow references or method calls.  (not a general
expression).  This will cause a syntax error to be thrown if the user puts a
full expression in, e.g. ($a > 2) instead of just a reference or method
call.  Then, change the code in the Nodes/ASTIfStatement.java to also throw
an exception if a non-boolean reference is passed in.

This gets more complicated if you want the syntax to be allowed/disallowed
via a user switch.  The problem is that the syntax definition is compiled
into a wide swath of code in the resulting file Parser.java file.  If you
want to have a switch, I'd guess you should then skip steps 1-3, and edit
the evaluation code to throw an eval-time error (as opposed to a parse-time
error that is thrown by default) if the child of the IF node is not a
reference or method node.

WILL

----- Original Message ----- 
From: "Tim Colson" <tc...@cisco.com>
To: "'Velocity Developers List'" <ve...@jakarta.apache.org>
Sent: Tuesday, July 01, 2003 1:16 PM
Subject: RE: Can comparisons be limited to true/false?


> Will -
>
> Thanks for the nudge...
> > (1) Write a custom directive #IfBoolean
>
> I wouldn't want a new directive. One of my unstated requirements was
> that the templates would continue to work with a standard velocity
> engine. Good idea, but I apologize for that omission. :-)
>
> Another unstated goal was to explicitly disallow expressions inside the
> #if() so that the templates would heavily limit designers (and me) from
> inadvertantly droping in logic.
>
> #if ($temp < 32) FREEZING #end
> versus
> #if ($temp.isBelowFreezing()) FREEZING #end
>
> The presentation might make FREEZING things bold and blue, but I prefer
> that the presentation layer does NOT define what FREEZING means. In my
> apps, I want that in a biz rule, and besides it likely varies - for
> example if the $temp is in Celsius or Fahrenheit, FREEZING is a
> different thing.
>
> > (2) Alter the Velocity source code. User javacc to compile a revised
> Parser.jjt.
> I'll have to read up a bit more on how javacc works, do you have a good
> reference link?
>
> > Since your syntax currently works in Velocity
> > (you want to limit what's acceptable, not add new syntax),
>
> Sorry, I'm a little confused. Does this mean that Parser.jjt (which I
> assume is a Javacc definition/config file) would -not- need to be
> altered?
>
> BTW - I don't want to break existing parsing functionality... I'd like
> to turn this strictness on/off with a switch on a per-template basis.
> (kinda like in Perl where you can specify a "use Strict;" on a script
> and then the perl interpreter will puke if you do nasty things... but
> you can turn off the flag so that included modules that aren't as picky
> can still run.)
>
> > I don't think  you'd have to do
> > anything else.  (correction: you'd need to change
> > ASTIfStatement.java to throw an exception for non-boolean references).
> Okay, I'll have a look at that.
>
> > This would be the section to revise in Parser.jjt.  You'd
> > need to change
> > "Expression()" to only allow a reference or a method call.
> >
> > void IfStatement() : {}
> > {
> >     <IF_DIRECTIVE> [<WHITESPACE>] <LPAREN> Expression() <RPAREN>
> >     ( Statement() )+ #Block
> >     [ LOOKAHEAD(1) ( ElseIfStatement() )+ ]
> >     [ LOOKAHEAD(1) ElseStatement() ]
> >     <END>
> > }
>
>
> While I was looking at ASTIfStatement, the first comment says:
> * Please look at the Parser.jjt file which is
>  * what controls the generation of this class.
>
> Hmmm... so if I patch that file, will another process of the build
> over-write my changes?
>
> Thanks for the help!
> Timo
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


RE: Can comparisons be limited to true/false?

Posted by Tim Colson <tc...@cisco.com>.
Will -

Thanks for the nudge...
> (1) Write a custom directive #IfBoolean  

I wouldn't want a new directive. One of my unstated requirements was
that the templates would continue to work with a standard velocity
engine. Good idea, but I apologize for that omission. :-)

Another unstated goal was to explicitly disallow expressions inside the
#if() so that the templates would heavily limit designers (and me) from
inadvertantly droping in logic.

#if ($temp < 32) FREEZING #end
versus
#if ($temp.isBelowFreezing()) FREEZING #end

The presentation might make FREEZING things bold and blue, but I prefer
that the presentation layer does NOT define what FREEZING means. In my
apps, I want that in a biz rule, and besides it likely varies - for
example if the $temp is in Celsius or Fahrenheit, FREEZING is a
different thing.
 
> (2) Alter the Velocity source code. User javacc to compile a revised
Parser.jjt.  
I'll have to read up a bit more on how javacc works, do you have a good
reference link?

> Since your syntax currently works in Velocity 
> (you want to limit what's acceptable, not add new syntax), 

Sorry, I'm a little confused. Does this mean that Parser.jjt (which I
assume is a Javacc definition/config file) would -not- need to be
altered? 

BTW - I don't want to break existing parsing functionality... I'd like
to turn this strictness on/off with a switch on a per-template basis.
(kinda like in Perl where you can specify a "use Strict;" on a script
and then the perl interpreter will puke if you do nasty things... but
you can turn off the flag so that included modules that aren't as picky
can still run.)

> I don't think  you'd have to do
> anything else.  (correction: you'd need to change 
> ASTIfStatement.java to throw an exception for non-boolean references).
Okay, I'll have a look at that.

> This would be the section to revise in Parser.jjt.  You'd 
> need to change
> "Expression()" to only allow a reference or a method call.
> 
> void IfStatement() : {}
> {
>     <IF_DIRECTIVE> [<WHITESPACE>] <LPAREN> Expression() <RPAREN>
>     ( Statement() )+ #Block
>     [ LOOKAHEAD(1) ( ElseIfStatement() )+ ]
>     [ LOOKAHEAD(1) ElseStatement() ]
>     <END>
> }


While I was looking at ASTIfStatement, the first comment says:
* Please look at the Parser.jjt file which is
 * what controls the generation of this class.

Hmmm... so if I patch that file, will another process of the build
over-write my changes?

Thanks for the help!
Timo






---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Can comparisons be limited to true/false?

Posted by Will Glass-Husain <wg...@forio.com>.
Hi Timo,

As I just delved into the parser code and it's fresh in my mind, let me
throw out two ideas...

(1) Write a custom directive #IfBoolean  that would operate as described.
The benefit is that you could use the "official" version of Velocity,
updating as new releases come out.

(2) Alter the Velocity source code. User javacc to compile a revised
Parser.jjt.  Since your syntax currently works in Velocity (you want to
limit what's acceptable, not add new syntax), I don't think you'd have to do
anything else.  (correction: you'd need to change ASTIfStatement.java to
throw an exception for non-boolean references).

This would be the section to revise in Parser.jjt.  You'd need to change
"Expression()" to only allow a reference or a method call.

void IfStatement() : {}
{
    <IF_DIRECTIVE> [<WHITESPACE>] <LPAREN> Expression() <RPAREN>
    ( Statement() )+ #Block
    [ LOOKAHEAD(1) ( ElseIfStatement() )+ ]
    [ LOOKAHEAD(1) ElseStatement() ]
    <END>
}

Best,
WILL

----- Original Message ----- 
From: "Tim Colson" <tc...@cisco.com>
To: "'Velocity Developers List'" <ve...@jakarta.apache.org>
Sent: Tuesday, July 01, 2003 9:31 AM
Subject: Can comparisons be limited to true/false?


> Howdy folks -
>   I'm wondering how I might limit the comparisons in velocity templates
> to only boolean conditions.
>
> For example:
> #if ($value > 20) HIGHLIGHTED BUTTON #else stdbutton #end
> would throw an exception and would need to be written with
> a context containing "IS_OVER_LIMIT", new Boolean() and this template:
> #if ($IS_OVER_LIMIT) HIGHLIGHTED BUTTON #else stdbutton #end
>
> Another example:
> #if ($widget.size == "LARGE")  large #else not large #end
> would throw an exception and would need to be written as:
> #if ($widget.size.isLarge())  large #else not large #end
>
> The question here is academic at this point. I do not care to argue
> about why this might be good/bad/weird, nor do I want to hear how it
> could be done in another engine.
>
> I'm just curious to know how one might go about messing with Velocity to
> alter it's behaviour as described. Maybe I'll learn something in the
> process of looking. :-)
>
> Thanks!
> Timo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Can comparisons be limited to true/false?

Posted by Jonathan Revusky <jo...@revusky.com>.
Tim Colson wrote:
> Jonathan wrote:
> 
>>Yeah, you anticipated it. The template engine that cannot be 
>>named does work the way you want.
> 
> Not according to the FM documentation I read - FM does not throw an
> exception when an IF conditional contains anytyhing other than a boolean
> reference.
> 
> So I assume Jonathan's suggested code modifications might change
> Velocity behaviour, but not as I described. 

I initially did not grasp what you wanted, but then I reread it and told 
you how to get the behavior you wanted. That was here:

http://www.mail-archive.com/velocity-dev%40jakarta.apache.org/msg07630.html


> 
> Other kind readers, please do not conclude that Jonathan's post answered
> my question. 

Conclude it. :-)

> He is simply getting in the way of me trying to learn more
> about how Velocity works.

<sigh>

*I* am getting in the way of your learning how Velocity works????

I can't even tell whether people are saying these things with a straight 
face. Lack of face-to-face interpersonal cues in this medium.

You cannot be serious! C'mon...

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
Velocity->FreeMarker template conversion tool, 
http://freemarker.org/usCavalry.html



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Can comparisons be limited to true/false?

Posted by Jonathan Revusky <jo...@revusky.com>.
Tim Colson wrote:
>>>Not according to the FM documentation I read - FM does not throw an
>>>exception when an IF conditional contains anytyhing other 
>>
>>than a boolean reference.
>>
>>I don't know what documentation did you read, but
>>http://www.freemarker.org/docs/ref_directive_if.html clearly says "The
>>condition-s must evaluate to a boolean value, or else an 
>>error will abort template processing".
> 
> 
> Attila -
> 
> I did read that :-) And it is not what I want.
> 
> I don't want an evaluated boolean expression... only a boolean
> reference.
> 
> #if ($foo == $bleck) -> Bzzzt. Throws an error
> #if ($foo > $bleck ) -> Bzzzt. Throws an error
> #if ($foo) assuming foo is an instanceof Boolean, then this would be
> fine.
> 
> Freemarker doesn't do that. Velocity doesn't do that. 
> I must remind, I don't care how FM does or doesn't do it - this was and
> is a Velocity question. If I wanted to know how I could make FM do this,
> I will join the freemarker mailing lists.
> 
> Thanks,
> Tim

I realized that was what you wanted after rereading the post. I told you 
how to achieve that here:

http://www.mail-archive.com/velocity-dev%40jakarta.apache.org/msg07630.html

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
Velocity->FreeMarker template conversion utility, 
http://freemarker.org/usCavalry.html



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: OT: Jonathan's ad hominem discussion

Posted by Daniel Dekany <dd...@freemail.hu>.
Friday, July 4, 2003, 11:12:11 AM, Henning P. Schmiedehausen wrote:

> Jonathan Revusky <jo...@revusky.com> writes:
>
>>Still not ad-hominem. I attacked your idea, and explained why I thought 
>>it was ill-advised.
>
> You wrote that it is necessary, to "keep your hand on your wallet"

Hey, don't cheat! That was in a different thread... the debated question
in this thread was if the concrete initial affair in this thread was ad
hominem or not... Not that it is interesting if it was or not -- it's
not a philosophy mailing list -- just if you debate then do it in
accordance with the rules.

> when being around on this list, which IMHO implies that you consider
> members of this list being thieves.
>
> This is, what I'd call "a personal attack". Worse, it's a perfidious
> below the belt attack.  The fact that you didn't actually write it
> down but just implied it, doesn't make it better.
[snip]

I'm not inherently determined to protect Jonathan (even if I'm a FM
contrib.), but these are artificial reasonings. *Obviously*, nobody will
think that Vel. people are actually pickpockets, also *obviously*
Jonathan didn't meant it verbatim, it was cleanly just a nasty sarcastic
note. OK, its an ugly thing to say things like this (i.e. that they are
thrives), but you know, this is something like if I say you: "You
shit!". It's offending, but nobody will think that you are actually from
excrement. So, simply put, it's ridiculous if you start to prove, that I
have slandered you, that you are from excrement (while you are form
flesh), because I want to discredit you. Actually, "You shit!" just
means that "I hate you!". Frankly, I think that you are just playing
with the words, be trying to to win some rhetorical battle: it was NOT
ad hominem attack. It's cleanly an artificial thing to start to use this
affair to prove ad hominem attacks. Also, and most importantly, I don't
believe that anybody can *really* be offended on things like this...
it's a such pretending... you realize that "Phew... this guy is really
angry about us..." and that's all.

> Your continous sneering and putting out side blows in all directions
> simpy obliterate your possible technical arguments. Most people that I
> know don't listen to any valuable input if it is delivered in an
> obnoxious way like yours is.
>
> You think, that developers will put up with your ego, if your
> "technical" input is good. That's wrong. Developers simply will stop
> listening to you, no matter what improvements you propose. Because
> your arguments drown in a continous drone of ridicule.

The whole self-exciting flaming is full with the lack of frankness and
with pretending (especially on the Vel. side), senseless offences
(especially on Jonathan's side) and glowing dispute that has lost any of
its original points (on both side), and today it exists solely for
itself. It's a bloated sh*t. And the conclusion that J.R. is an utterly
terrible man, so he will drive you crazy if you are an FM
user/developer... is, as a matter of fact, mistaken.

> You seem to expect that everyone discusses only "technical"
> information and you're allowed to deliver your snide comments "from
> high" because of your conceived supremacy to us mere mortals.
>
> To me, who knew zilch about FreeMarker some weeks ago, the whole FM
> project now feels like "technical interesting, but the surrounding
> people have a serious problem towards anything Apache". Continous
> putting down of other projects isn't a good way to promote the
> superiority of your own project. It seems that there is some

Can you imagine that somebody puts down a project because he *really*
thinks that the project is technically inferior? And not because of some
religious or political reasons?

> desparation because an "abandoned, sub-standard" thing like Velocity
> has a much, much larger user base than FM, simply because it is "ASF".

(which is BTW, I strongly believe, true...)

> But putting it down won't help FreeMarker at all. This is, what you
> don't seem to grasp.

Kind of political question... but I also think it doesn't help FM.

> Jonathan, we _all_ have noticed that you're "much better at writing
> templating engines" than this group of developers (your words). You
> rubbed it in many times and at least I am now under the firm
> impression that your technical abilities go along with a serious ego
> problem. Which is bad, because the _only_ thing that stands beween me
> and testing out FreeMarker in a production environment is actually
> your ego and the prospect of having to work with people that have
> attitude problems like you if a problem crops up.
[snip]

It's mistaken. An important difference between Vel. and FM. community is
exactly that FM developers respect criticism more from the users. And
you will not be bashed just because you tell negative critics... well,
except if you say *utter* nonsense. If something is s*it, then you can
tell that that's s*it; nobody will be offended.

-- 
Best regards,
 Daniel Dekany



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: OT: Jonathan's ad hominem discussion

Posted by Jonathan Revusky <jo...@revusky.com>.
Henning P. Schmiedehausen wrote:
> Jonathan Revusky <jo...@revusky.com> writes:
> 
> 
>>Still not ad-hominem. I attacked your idea, and explained why I thought 
>>it was ill-advised.
> 
> 
> You wrote that it is necessary, to "keep your hand on your wallet"
> when being around on this list, which IMHO implies that you consider
> members of this list being thieves.
> 
> This is, what I'd call "a personal attack". Worse, it's a perfidious
> below the belt attack.  The fact that you didn't actually write it
> down but just implied it, doesn't make it better.

I feel it was quite appropriate. I was responding to a bunch of phony 
drivel about how everybody loves me and wants to have a big group hug. I 
sarcastically stated that it would be a partial hug in my case because I 
wanted to keep one hand on my wallet. I was indicating that I perceived 
extreme phoniness on the part of these people and that therefore I 
didn't trust them any further than I could throw them.

> 
> Your continous sneering and putting out side blows in all directions
> simpy obliterate your possible technical arguments. Most people that I
> know don't listen to any valuable input if it is delivered in an
> obnoxious way like yours is.

Now, this, for example is, just ad-hominem drivel. I'm obnoxious, I'm 
this, I'm that, so that discredits or devalues any technical point I made.

Pure ad hominem.

Besides, I have had enough interaction with you recently, Henning, to 
know how obnoxious you are, so, you know... you're in a glass house 
throwing stones anyway.

> 
> You think, that developers will put up with your ego, if your
> "technical" input is good. That's wrong. Developers simply will stop
> listening to you, no matter what improvements you propose. Because
> your arguments drown in a continous drone of ridicule. You seem to
> expect that everyone discusses only "technical" information and you're
> allowed to deliver your snide comments "from high" because of your
> conceived supremacy to us mere mortals.

The stuff about my great ego is very overblown. The fact remains that, 
as I have said, there has been no ongoing development on Velocity over 
the past year. Nothing. No CVS commits. No new features, no bug-fixes, 
no improvements in documentation or examples. No nothing.

For me to contrast favorably my efforts and that of the FreeMarker 
community with the above-described situation does not require some 
inflated ego. It boils down to the fact that we are comparing a serious 
ongoing development effort (on the FreeMarker side) with *absolutely 
nothing* (on the Velocity side).

Obviously the results of a year of our hard work are going to be better 
than the results of a year of *doing absolutely nothing at all*.

So, to say this is not so terribly egotistical... <shrug>

> 
> To me, who knew zilch about FreeMarker some weeks ago, 

Henning, I am confident that you still know zilch about FreeMarker.

> the whole FM
> project now feels like "technical interesting, but the surrounding
> people have a serious problem towards anything Apache". 

So what? That's just more irrelevant ad-hominem type stuff.

> Continous
> putting down of other projects isn't a good way to promote the
> superiority of your own project. It seems that there is some
> desparation because an "abandoned, sub-standard" thing like Velocity
> has a much, much larger user base than FM, simply because it is
> "ASF". But putting it down won't help FreeMarker at all. This is, what
> you don't seem to grasp.

Maybe not. But there is nothing ethically or morally wrong with my 
pointing out the true state of the Velocity project. I have noticed an 
ongoing attempt to mask the truth. Over the last months, I have 
perceived a tacit agreement here to keep talking about the project as if 
it was alive, as if ongoing development was taking place. "Maybe the 
committers will do this". "Have you submitted a patch for that?" And so 
on. They even put out a release in April that was identical to the 
previous release 8 months prior simply to give the impression that 
something was happening.

It seems right and proper for me to say that the emperor is wearing no 
clothes. That actually could be beneficial to the Velocity project if 
people respond pro-actively to that wake-up call. Whether it's 
beneficial to FreeMarker or not, I don't know. But that's not relevant 
anyway.


> 
> Jonathan, we _all_ have noticed that you're "much better at writing
> templating engines" than this group of developers (your words). You
> rubbed it in many times and at least I am now under the firm
> impression that your technical abilities go along with a serious ego
> problem. Which is bad, because the _only_ thing that stands beween me
> and testing out FreeMarker in a production environment is actually
> your ego and the prospect of having to work with people that have
> attitude problems like you if a problem crops up.
> 
> If you were able to exhale, you might have been able to persuade some
> velocity users to try out and maybe use FreeMarker. But I'm pretty
> sure, that most developers and users that read the archive of the
> discussion of the last days will not touch FM with a ten-feet pole.

This is just speculation on your part. Actually, many of the people 
showing up on the FreeMarker lists are pretty obviously Velocity refugees.

> 
> That's your personal achievement and has nothing to do with technical
> aspects of any templating engine or one being superior to the
> other. It's your attitude and that's the truth.

The above is just more irrelevant ad-hominem smoke-blowing.

Regards,

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
Use JSP taglibs from a FreeMarker template: 
http://freemarker.org/docs/pgui_misc_servlet.html

> 
> 	Regards
> 		Henning
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: OT: Jonathan's ad hominem discussion

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Jonathan Revusky <jo...@revusky.com> writes:

>Still not ad-hominem. I attacked your idea, and explained why I thought 
>it was ill-advised.

You wrote that it is necessary, to "keep your hand on your wallet"
when being around on this list, which IMHO implies that you consider
members of this list being thieves.

This is, what I'd call "a personal attack". Worse, it's a perfidious
below the belt attack.  The fact that you didn't actually write it
down but just implied it, doesn't make it better.

Your continous sneering and putting out side blows in all directions
simpy obliterate your possible technical arguments. Most people that I
know don't listen to any valuable input if it is delivered in an
obnoxious way like yours is.

You think, that developers will put up with your ego, if your
"technical" input is good. That's wrong. Developers simply will stop
listening to you, no matter what improvements you propose. Because
your arguments drown in a continous drone of ridicule. You seem to
expect that everyone discusses only "technical" information and you're
allowed to deliver your snide comments "from high" because of your
conceived supremacy to us mere mortals.

To me, who knew zilch about FreeMarker some weeks ago, the whole FM
project now feels like "technical interesting, but the surrounding
people have a serious problem towards anything Apache". Continous
putting down of other projects isn't a good way to promote the
superiority of your own project. It seems that there is some
desparation because an "abandoned, sub-standard" thing like Velocity
has a much, much larger user base than FM, simply because it is
"ASF". But putting it down won't help FreeMarker at all. This is, what
you don't seem to grasp.

Jonathan, we _all_ have noticed that you're "much better at writing
templating engines" than this group of developers (your words). You
rubbed it in many times and at least I am now under the firm
impression that your technical abilities go along with a serious ego
problem. Which is bad, because the _only_ thing that stands beween me
and testing out FreeMarker in a production environment is actually
your ego and the prospect of having to work with people that have
attitude problems like you if a problem crops up.

If you were able to exhale, you might have been able to persuade some
velocity users to try out and maybe use FreeMarker. But I'm pretty
sure, that most developers and users that read the archive of the
discussion of the last days will not touch FM with a ten-feet pole.

That's your personal achievement and has nothing to do with technical
aspects of any templating engine or one being superior to the
other. It's your attitude and that's the truth.

	Regards
		Henning


-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

--- Quote of the week: "It is pointless to tell people anything when
you know that they won't process the message." --- Jonathan Revusky

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


RE: OT: Jonathan's ad hominem discussion

Posted by Tim Colson <tc...@cisco.com>.
> Still not ad-hominem. I attacked your idea, and explained why 
> I thought  it was ill-advised.
Along the way insinuating that someone would be daft, nutty, and
perverse to come up with the idea. What is amazing is that the attack
was based on lack of reading comprehension.
 
> That's beyond my control really. It wasn't ad hominem.
It was an attack in _my opinion_. The proper response might be to say,
"I'm sorry, I didn't understand the question, and I apologize for
attributing my incorrect conclusions to you and making statements about
the idea and the character of the person who generated them." 

> It's a rough-and-tumble world, Tim. Do you think anybody 
> cares very much?
I'm sure you realize the fallacy made by this statement.

> I limit my response basically to pointing out that, contrary 
> to what you say, I did not engage in any ad hominem attack on you.
"Abusive: An Abusive Ad Hominem occurs when an attack on the character
or other irrelevant personal qualities of the opposition--such as
appearance--is offered as evidence against her position. Such attacks
are often effective distractions ("red herrings"), because the opponent
feels it necessary to defend herself, thus being distracted from the
topic of the debate."

I have expressed why it is indeed in my opinion an Abusive Ad Hominem
fallacy - as proven again by my perceived need to defend my character
rather than discuss the topic. 

And as such, since this is my opinion, there is no point in arguing it.


-Tim





---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: OT: Jonathan's ad hominem discussion

Posted by Jonathan Revusky <jo...@revusky.com>.
Tim Colson wrote:
>>>>It seems a bit daft.
>>>>AFAICS, this is based on some perverse, distorted version of the MVC
>>>>paradigm.
>>>>Anyway, that's what Tim Colson wants, and it's nutty enough 
>>>>that neither 
> 
> 
>>An ad hominem attack is necessarily on another person's 
>>character, not  on their ideas. 
> 
> Agreed. And by saying that my request was "daft" and based on "some
> perverse, distorted..." which I took to implies and insinuate that I
> have those qualities of character in order to create such an idea. That
> is offensive to me. 

Still not ad-hominem. I attacked your idea, and explained why I thought 
it was ill-advised.

> 
> 
>>When I said that your idea seemed 'a bit daft' or 
>>'nutty' and explained why I thought this, that was not an ad 
>>hominem attack.
> 
> This insults and offends me even more! 

That's beyond my control really. It wasn't ad hominem.

> Please, do not tell me what my
> opinion is on the matter of being offended! I know quite well that and I
> am offended. 

It's a rough-and-tumble world, Tim. Do you think anybody cares very much?

> 
> 
> 
>>>The speciulation is incorrect, and the attacks are
>>>offensive.
>>
>>Could you please outline what is incorrect about it?
> 
> The speculation that this idea was based on some "perverse, distorted
> MVC paradigm" was incorrect.
> 
> Despite needing no defense, I previously outlined in faily simple
> language that this question about how one might modify the velocity
> engine to limit comparisons to booleans was academic and based on the
> modus operandi of another template language I use in PERL called
> HTML::Template.
> 
> There is no need for reply unless it contains apologies for offending me
> (yet again) and wasting my time repeating myself explaining rationale
> that should not have required any explanation in the first place.

I limit my response basically to pointing out that, contrary to what you 
say, I did not engage in any ad hominem attack on you. I simply 
expressed my highly negative reaction to your idea. That's not 
ad-hominem. Moreover, despite my negative reaction to your idea, I ave 
you step-by-step instructions on how to implement it.

Regards,

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
Velocity->FreeMarker template conversion utility, 
http://freemarker.org/usCavalry.html

> 
> -Tim



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


RE: OT: Jonathan's ad hominem discussion (was: Can comparisons be limited to true/false? )

Posted by Bill Chmura <Bi...@Explosivo.com>.
You must let these things go... Only then can you be free.  The demon on
your back makes you respond like this doesn't it?  You did not really
want to write this, but could not stop yourself.   We we're / are making
such progress...  We have at least three people on the list who want to
love you.  Think of what you could have done with the time you spent
responding to this...  Read a book, watched a sunset, tweeked freemarker
a little, enjoyed a frosty cold beverage.

He me help you


  > -----Original Message-----
  > From: news [mailto:news@main.gmane.org] On Behalf Of 
  > Jonathan Revusky
  > Sent: Saturday, July 05, 2003 3:15 AM
  > To: velocity-dev@jakarta.apache.org
  > Subject: Re: OT: Jonathan's ad hominem discussion (was: Can 
  > comparisons be limited to true/false? )
  > 
  > 
  > Henning P. Schmiedehausen wrote:
  > > Daniel Dekany <dd...@freemail.hu> writes:
  > > 
  > > Can you (and everyone else) please take this discussion 
  > off a project 
  > > development list.
  > > 
  > > Personally, I'm not interested in the various ego 
  > problems cropping up 
  > > here.
  > 
  > Henning, then why did you just separately contribute a long 
  > tirade to 
  > the thread??? You know, this long post going on about how I'm so 
  > terrible and egotistical, just completely off-topic 
  > personality stuff...
  > 
  > And really, it's just A-1-A ad-hominem stuff. That's what 
  > all of these 
  > personal attacks on me are. I have pointed out that 
  > Velocity development 
  > has been at a standstill for a year or more. I have pointed 
  > out quite 
  > factually various deficiencies in the tool, and said quite 
  > truthfully 
  > that these problems have been addressed in a competing tool 
  > in the same 
  > space.
  > 
  > The lack of development, and that the tool is falling further and 
  > further behind other things, these are simply facts and 
  > they are things 
  > the Velocity community should address. Meanwhile, my deplorable 
  > personality is not something they can do anything about 
  > anyway. So the 
  > tirades against my person are obviously just an attempt to 
  > blow smoke to 
  > obscure the real issue.
  > 
  > Not only that, but it gets increasingly clownish. Look at the 
  > Velocity-user list. You have somebody proposing censorship. 
  > However, 
  > when asked to provide a concrete example of the material I 
  > have written 
  > that requires censorship, the guy simply won't provide any. 
  > This doesn't 
  > prevent other people from +1'ing the censorship proposal 
  > (to be fair, 
  > you were -1 on that crazy idea) but these other people also 
  > will not 
  > provide any concrete example of the egregious material that 
  > needs to be 
  > censored.
  > 
  > Quite obviously, they simply don't like me pointing out the 
  > real state 
  > of this project. Also, they don't like me pointing out 
  > truthfully that a 
  > competing tool has features lacking in Velocity that a user wants. 
  > Basically, they want to censor truthful, on-topic comments that put 
  > their development efforts (lack thereof, I mean) in a 
  > negative light. Of 
  > course, they won't provide concrete examples of such 
  > material that they 
  > want to censor because that would make them a laughing 
  > stock -- I mean, 
  > even more of a laughing stock than they currently are. After all, 
  > there's no getting away from it; to propose censorship and 
  > be unwilling 
  > to provide any concrete example of the material you want to 
  > censor... 
  > that's pretty lame.
  > 
  > Jonathan Revusky
  > --
  > lead developer, FreeMarker project, http://freemarker.org/ 
  > Check out FreeMarker's powerful macro system: 
  > http://freemarker.org/docs/dgui_misc_userdefdir.html
  > 
  > 
  > 
  > 
  > > 
  > > 	Thanks
  > > 		Henning
  > 
  > 
  > 
  > 
  > ------------------------------------------------------------
  > ---------
  > To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
  > For additional commands, e-mail: 
  > velocity-dev-help@jakarta.apache.org
  > 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: OT: Jonathan's ad hominem discussion (was: Can comparisons be limited to true/false? )

Posted by Jonathan Revusky <jo...@revusky.com>.
Henning P. Schmiedehausen wrote:
> Daniel Dekany <dd...@freemail.hu> writes:
> 
> Can you (and everyone else) please take this discussion off a project
> development list.
> 
> Personally, I'm not interested in the various ego problems cropping up
> here.

Henning, then why did you just separately contribute a long tirade to 
the thread??? You know, this long post going on about how I'm so 
terrible and egotistical, just completely off-topic personality stuff...

And really, it's just A-1-A ad-hominem stuff. That's what all of these 
personal attacks on me are. I have pointed out that Velocity development 
has been at a standstill for a year or more. I have pointed out quite 
factually various deficiencies in the tool, and said quite truthfully 
that these problems have been addressed in a competing tool in the same 
space.

The lack of development, and that the tool is falling further and 
further behind other things, these are simply facts and they are things 
the Velocity community should address. Meanwhile, my deplorable 
personality is not something they can do anything about anyway. So the 
tirades against my person are obviously just an attempt to blow smoke to 
obscure the real issue.

Not only that, but it gets increasingly clownish. Look at the 
Velocity-user list. You have somebody proposing censorship. However, 
when asked to provide a concrete example of the material I have written 
that requires censorship, the guy simply won't provide any. This doesn't 
prevent other people from +1'ing the censorship proposal (to be fair, 
you were -1 on that crazy idea) but these other people also will not 
provide any concrete example of the egregious material that needs to be 
censored.

Quite obviously, they simply don't like me pointing out the real state 
of this project. Also, they don't like me pointing out truthfully that a 
competing tool has features lacking in Velocity that a user wants. 
Basically, they want to censor truthful, on-topic comments that put 
their development efforts (lack thereof, I mean) in a negative light. Of 
course, they won't provide concrete examples of such material that they 
want to censor because that would make them a laughing stock -- I mean, 
even more of a laughing stock than they currently are. After all, 
there's no getting away from it; to propose censorship and be unwilling 
to provide any concrete example of the material you want to censor... 
that's pretty lame.

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
Check out FreeMarker's powerful macro system: 
http://freemarker.org/docs/dgui_misc_userdefdir.html




> 
> 	Thanks
> 		Henning




---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: OT: Jonathan's ad hominem discussion (was: Can comparisons be limited to true/false? )

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Daniel Dekany <dd...@freemail.hu> writes:

Can you (and everyone else) please take this discussion off a project
development list.

Personally, I'm not interested in the various ego problems cropping up
here.

	Thanks
		Henning
-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

--- Quote of the week: "It is pointless to tell people anything when
you know that they won't process the message." --- Jonathan Revusky

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: OT: Jonathan's ad hominem discussion (was: Can comparisons be limited to true/false? )

Posted by Jonathan Revusky <jo...@revusky.com>.
Ed Korthof wrote:
> On Thu, Jul 03, 2003 at 06:57:19PM +0200, Daniel Dekany wrote:
> 
>>Thursday, July 3, 2003, 4:56:40 PM, Tim Colson wrote:
>>
>>
>>>>>>It seems a bit daft.
>>>>>>AFAICS, this is based on some perverse, distorted version of the MVC
>>>>>>paradigm.
>>>>>>Anyway, that's what Tim Colson wants, and it's nutty enough 
>>>>>>that neither 
>>>
>>>>An ad hominem attack is necessarily on another person's 
>>>>character, not  on their ideas. 
>>>
>>>Agreed. And by saying that my request was "daft" and based on "some
>>>perverse, distorted..." which I took to implies and insinuate that I
>>>have those qualities of character in order to create such an idea. That
>>>is offensive to me. 
>>
>>Well, if its an OT thread anyway... a little theological course (seems
>>that FM people are experts in this field... :)). Ad hominem attack is
>>when the other persons tells something that is *irrelevant* regarding
>>the disputed question, to discredit you in general. For example, I say
>>that Vel. people was unfair with WebMacro people, and then the a Vel.
>>people bring up that: "Note that Daniel was in prison for 3 times
>>because of raping... he is a such man." This discredits everything else
>>what I said, because I'm such a bad man in general. In this case I have
>>suffered an Ad hominem attack. Typical method in politics.
>>
>>If somebody thinks that your idea is a nonsense, and he tells you that
>>"You are an IDIOOOOOT!", then it cleanly means that he strongly believes
>>that your idea is an utter nonsense, *this way* you must be stupid,
>>brain-damaged, etc. Now, this can be offending, and can be an attack,
>>but it's in no way an *Ad hominem* attack.
> 
> 
> I don't think your definition is correct:
> 
> http://dictionary.reference.com/search?q=Ad+hominem&db=*
> 
> Certainly the usage that I'm familiar with allows for ad hominem attacks
> to be pertinent, but separate from the real topic.  That is, describing
> the person as daft would qualify, even if it has some bearing on the
> discussion; but calling the idea daft does not (in the quote above, it
> is the idea that is described that way).  

The idea was described as daft. It was always the ideas that were being 
characterized negatively, not the person.

There was no ad-hominem attack.

Regards,

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
FreeMarker XML transformation capabilities, 
http://freemarker.org/docs/xgui.html


Language is usage of course,
> and it does change.
> 
> Using the phrase "perverse, distorted" is stands out because of the
> extremely strong connotations associated with "perverse ideas" -- it's
> hard to avoid that there is a certain degree of personal smearing going
> on when that term is used rather than something more neutral like:
> "based on an incorrect idea of the MVC paradigm."  The words used do
> suggest this could be described as "ad hominem abusive":
> 
> http://www.datanation.com/fallacies/attack.htm
> 
> Regardless of the definition you choose want to use for ad hominem, from
> my perspective as a lurker, the terms used seemed excessive and
> unhelpful, and they did seem designed to attack the person as someone
> worth of being dismissed.
> 
> cheers --
> 
> Ed, who has used -- and does not like -- templating systems which allow
> no real logic in the display layer



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: OT: Jonathan's ad hominem discussion (was: Can comparisons be limited to true/false? )

Posted by Ed Korthof <ed...@apache.org>.
On Thu, Jul 03, 2003 at 06:57:19PM +0200, Daniel Dekany wrote:
> Thursday, July 3, 2003, 4:56:40 PM, Tim Colson wrote:
> 
> >> >>It seems a bit daft.
> >> >>AFAICS, this is based on some perverse, distorted version of the MVC
> >> >>paradigm.
> >> >>Anyway, that's what Tim Colson wants, and it's nutty enough 
> >> >>that neither 
> >
> >> An ad hominem attack is necessarily on another person's 
> >> character, not  on their ideas. 
> > Agreed. And by saying that my request was "daft" and based on "some
> > perverse, distorted..." which I took to implies and insinuate that I
> > have those qualities of character in order to create such an idea. That
> > is offensive to me. 
> 
> Well, if its an OT thread anyway... a little theological course (seems
> that FM people are experts in this field... :)). Ad hominem attack is
> when the other persons tells something that is *irrelevant* regarding
> the disputed question, to discredit you in general. For example, I say
> that Vel. people was unfair with WebMacro people, and then the a Vel.
> people bring up that: "Note that Daniel was in prison for 3 times
> because of raping... he is a such man." This discredits everything else
> what I said, because I'm such a bad man in general. In this case I have
> suffered an Ad hominem attack. Typical method in politics.
> 
> If somebody thinks that your idea is a nonsense, and he tells you that
> "You are an IDIOOOOOT!", then it cleanly means that he strongly believes
> that your idea is an utter nonsense, *this way* you must be stupid,
> brain-damaged, etc. Now, this can be offending, and can be an attack,
> but it's in no way an *Ad hominem* attack.

I don't think your definition is correct:

http://dictionary.reference.com/search?q=Ad+hominem&db=*

Certainly the usage that I'm familiar with allows for ad hominem attacks
to be pertinent, but separate from the real topic.  That is, describing
the person as daft would qualify, even if it has some bearing on the
discussion; but calling the idea daft does not (in the quote above, it
is the idea that is described that way).  Language is usage of course,
and it does change.

Using the phrase "perverse, distorted" is stands out because of the
extremely strong connotations associated with "perverse ideas" -- it's
hard to avoid that there is a certain degree of personal smearing going
on when that term is used rather than something more neutral like:
"based on an incorrect idea of the MVC paradigm."  The words used do
suggest this could be described as "ad hominem abusive":

http://www.datanation.com/fallacies/attack.htm

Regardless of the definition you choose want to use for ad hominem, from
my perspective as a lurker, the terms used seemed excessive and
unhelpful, and they did seem designed to attack the person as someone
worth of being dismissed.

cheers --

Ed, who has used -- and does not like -- templating systems which allow
no real logic in the display layer

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: OT: Jonathan's ad hominem discussion (was: Can comparisons be limited to true/false? )

Posted by Daniel Dekany <dd...@freemail.hu>.
Thursday, July 3, 2003, 4:56:40 PM, Tim Colson wrote:

>> >>It seems a bit daft.
>> >>AFAICS, this is based on some perverse, distorted version of the MVC
>> >>paradigm.
>> >>Anyway, that's what Tim Colson wants, and it's nutty enough 
>> >>that neither 
>
>> An ad hominem attack is necessarily on another person's 
>> character, not  on their ideas. 
> Agreed. And by saying that my request was "daft" and based on "some
> perverse, distorted..." which I took to implies and insinuate that I
> have those qualities of character in order to create such an idea. That
> is offensive to me. 

Well, if its an OT thread anyway... a little theological course (seems
that FM people are experts in this field... :)). Ad hominem attack is
when the other persons tells something that is *irrelevant* regarding
the disputed question, to discredit you in general. For example, I say
that Vel. people was unfair with WebMacro people, and then the a Vel.
people bring up that: "Note that Daniel was in prison for 3 times
because of raping... he is a such man." This discredits everything else
what I said, because I'm such a bad man in general. In this case I have
suffered an Ad hominem attack. Typical method in politics.

If somebody thinks that your idea is a nonsense, and he tells you that
"You are an IDIOOOOOT!", then it cleanly means that he strongly believes
that your idea is an utter nonsense, *this way* you must be stupid,
brain-damaged, etc. Now, this can be offending, and can be an attack,
but it's in no way an *Ad hominem* attack.

>> When I said that your idea seemed 'a bit daft' or 
>> 'nutty' and explained why I thought this, that was not an ad 
>> hominem attack.
> This insults and offends me even more! Please, do not tell me what my
> opinion is on the matter of being offended! I know quite well that and I
> am offended.
[snip]

It's amazing how gentle souls people are... :)

-- 
Best regards,
 Daniel Dekany



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


OT: Jonathan's ad hominem discussion (was: Can comparisons be limited to true/false? )

Posted by Tim Colson <tc...@cisco.com>.
> >>It seems a bit daft.
> >>AFAICS, this is based on some perverse, distorted version of the MVC
> >>paradigm.
> >>Anyway, that's what Tim Colson wants, and it's nutty enough 
> >>that neither 

> An ad hominem attack is necessarily on another person's 
> character, not  on their ideas. 
Agreed. And by saying that my request was "daft" and based on "some
perverse, distorted..." which I took to implies and insinuate that I
have those qualities of character in order to create such an idea. That
is offensive to me. 

> When I said that your idea seemed 'a bit daft' or 
> 'nutty' and explained why I thought this, that was not an ad 
> hominem attack.
This insults and offends me even more! Please, do not tell me what my
opinion is on the matter of being offended! I know quite well that and I
am offended. 


> > The speciulation is incorrect, and the attacks are
> > offensive.
> Could you please outline what is incorrect about it?
The speculation that this idea was based on some "perverse, distorted
MVC paradigm" was incorrect.

Despite needing no defense, I previously outlined in faily simple
language that this question about how one might modify the velocity
engine to limit comparisons to booleans was academic and based on the
modus operandi of another template language I use in PERL called
HTML::Template.

There is no need for reply unless it contains apologies for offending me
(yet again) and wasting my time repeating myself explaining rationale
that should not have required any explanation in the first place.

-Tim


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Can comparisons be limited to true/false?

Posted by Jonathan Revusky <jo...@revusky.com>.
Tim Colson wrote:
> Jonathan wrote:
> 
>>What this guy wants -- believe it or not -- 
> 
> Please stop putting words in my mouth. Obviously since you didn't
> understand my initial question, you are not qualified to speak for me!
> 
> 
>>It seems a bit daft.
>>AFAICS, this is based on some perverse, distorted version of the MVC 
>>paradigm.
>>Anyway, that's what Tim Colson wants, and it's nutty enough 
>>that neither 
> 
> 
> And please refrain from speculation and ad hominem attacks on my
> character and ideas. 

An ad hominem attack is necessarily on another person's character, not 
on their ideas. When I said that your idea seemed 'a bit daft' or 
'nutty' and explained why I thought this, that was not an ad hominem attack.

> The speciulation is incorrect, and the attacks are
> offensive.

Could you please outline what is incorrect about it?

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
FreeMarker-Velocity comparison page, http://freemarker.org/fmVsVel.html

> 
> I don't need to justify this to anyone, but if you read the first post
> again, perhaps you'll notice that I said that the question was academic.
> I am trying to learn who Velocity works and what would theoretically
> need to be done to significantly change the way the templates are
> parsed.
> 
> Tim



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


RE: Can comparisons be limited to true/false?

Posted by Tim Colson <tc...@cisco.com>.
Jonathan wrote:
> What this guy wants -- believe it or not -- 
Please stop putting words in my mouth. Obviously since you didn't
understand my initial question, you are not qualified to speak for me!

> It seems a bit daft.
> AFAICS, this is based on some perverse, distorted version of the MVC 
> paradigm.
> Anyway, that's what Tim Colson wants, and it's nutty enough 
> that neither 

And please refrain from speculation and ad hominem attacks on my
character and ideas. The speciulation is incorrect, and the attacks are
offensive.

I don't need to justify this to anyone, but if you read the first post
again, perhaps you'll notice that I said that the question was academic.
I am trying to learn who Velocity works and what would theoretically
need to be done to significantly change the way the templates are
parsed.

Tim


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Can comparisons be limited to true/false?

Posted by Jonathan Revusky <jo...@revusky.com>.
Attila Szegedi wrote:
> ----- Original Message -----
> From: "Tim Colson" <tc...@cisco.com>
> To: "'Velocity Developers List'" <ve...@jakarta.apache.org>
> Sent: Tuesday, July 01, 2003 10:07 PM
> Subject: RE: Can comparisons be limited to true/false?
> 
> 
> 
>>Not according to the FM documentation I read - FM does not throw an
>>exception when an IF conditional contains anytyhing other than a boolean
>>reference.
>>
> 
> 
> I don't know what documentation did you read, but
> http://www.freemarker.org/docs/ref_directive_if.html clearly says "The
> condition-s must evaluate to a boolean value, or else an error will abort
> template processing".

Attila,

What this guy wants -- believe it or not -- is simply to disallow 
explicit comparisons on template pages. He wants to prevent people from 
writing:

#if (x == y)

and thus oblige the programmer to put a boolean variable xEqualsY in the 
context, despite the fact that both x and y are already in the context 
and could (with the usual disposition) be compared perfectly well.

Then anybody working on the template level would have to write instead:

#if (xEqualsY)

It seems a bit daft. You then have to document the existence of all 
these boolean variables. And then, when the template writer wants to 
compare x and z, say, and there is no ready-made boolean variable in the 
context for this, he has to come running to the programmer to ask for this.

AFAICS, this is based on some perverse, distorted version of the MVC 
paradigm.

Anyway, that's what Tim Colson wants, and it's nutty enough that neither 
you nor I, on first reading, quite grasped what he was asking for; we 
thought he just wanted the stricter semantics (as implemented in the 
"template engine that cannot be named") where a non-boolean in a boolean 
context (like a string or number or whatever) was considered an error.

<sigh>

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
FreeMarker-Velocity comparison page, http://freemarker.org/fmVsVel.html

> 
> Regards,
>   Attila.



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


RE: Can comparisons be limited to true/false?

Posted by Bill Chmura <Bi...@Explosivo.com>.
I did some work with HTML::Template...  Sam, as I remember, is quite
adamant about a number of things :) He has his idea of what it does and
that's that!  Great guy though. I still use it for all of my perl needs.
I was considering using the java version until I found velocity


-----Original Message-----
From: Tim Colson [mailto:tcolson@cisco.com] 
Sent: Wednesday, July 02, 2003 10:09 AM
To: 'Velocity Developers List'
Subject: RE: Can comparisons be limited to true/false?


> I see. You want to allow only a single reference that evaluates to a 
> boolean, and want to exclude more complex expressions altogether.
I'm pretty sure that is correct to say. But the semantics can be a
little confusing. $foo.bar.bleck must 'evaluate' to a boolean, but even
though the expression $foo > $bar does 'evaluate' to a boolean -> I
don't want to allow that.

> Why would this behavior be desirable?
I'm not saying it would be. I'm curious how I might make it happen. It
is an academic pursuit. Next week, I may ask how I might change #if to
<IF>. 

I got the idea, by the way, from another template system that I use in
Perl called HTML::Template.
http://html-template.sourceforge.net/html_template.html

Sam Tregar, the author, is a well respected chap who has been building
webapps for a long time. He happens to be adamant that comparisons not
leak into the template, so HTML::Template only allows boolean references
in TMPL_IF tags.

Tim
 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


RE: Can comparisons be limited to true/false?

Posted by Tim Colson <tc...@cisco.com>.
> I see. You want to allow only a single reference that evaluates to a
> boolean, and want to exclude more complex expressions 
> altogether. 
I'm pretty sure that is correct to say. But the semantics can be a
little confusing. $foo.bar.bleck must 'evaluate' to a boolean, but even
though the expression $foo > $bar does 'evaluate' to a boolean -> I
don't want to allow that.

> Why would this behavior be desirable?
I'm not saying it would be. I'm curious how I might make it happen. It
is an academic pursuit. Next week, I may ask how I might change #if to
<IF>. 

I got the idea, by the way, from another template system that I use in
Perl called HTML::Template.
http://html-template.sourceforge.net/html_template.html

Sam Tregar, the author, is a well respected chap who has been building
webapps for a long time. He happens to be adamant that comparisons not
leak into the template, so HTML::Template only allows boolean references
in TMPL_IF tags.

Tim
 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Can comparisons be limited to true/false?

Posted by Attila Szegedi <sz...@freemail.hu>.
I see. You want to allow only a single reference that evaluates to a
boolean, and want to exclude more complex expressions altogether. Why would
this behavior be desirable?

Attila.

----- Original Message -----
From: "Tim Colson" <tc...@cisco.com>
To: "'Velocity Developers List'" <ve...@jakarta.apache.org>
Sent: Wednesday, July 02, 2003 12:06 AM
Subject: RE: Can comparisons be limited to true/false?


> >
> > > Not according to the FM documentation I read - FM does not throw an
> > > exception when an IF conditional contains anytyhing other
> > than a boolean reference.
> > >
> > I don't know what documentation did you read, but
> > http://www.freemarker.org/docs/ref_directive_if.html clearly says "The
> > condition-s must evaluate to a boolean value, or else an
> > error will abort template processing".
>
> Attila -
>
> I did read that :-) And it is not what I want.
>
> I don't want an evaluated boolean expression... only a boolean
> reference.
>
> #if ($foo == $bleck) -> Bzzzt. Throws an error
> #if ($foo > $bleck ) -> Bzzzt. Throws an error
> #if ($foo) assuming foo is an instanceof Boolean, then this would be
> fine.
>
> Freemarker doesn't do that. Velocity doesn't do that.
> I must remind, I don't care how FM does or doesn't do it - this was and
> is a Velocity question. If I wanted to know how I could make FM do this,
> I will join the freemarker mailing lists.
>
> Thanks,
> Tim
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


RE: Can comparisons be limited to true/false?

Posted by Tim Colson <tc...@cisco.com>.
> 
> > Not according to the FM documentation I read - FM does not throw an
> > exception when an IF conditional contains anytyhing other 
> than a boolean reference.
> >
> I don't know what documentation did you read, but
> http://www.freemarker.org/docs/ref_directive_if.html clearly says "The
> condition-s must evaluate to a boolean value, or else an 
> error will abort template processing".

Attila -

I did read that :-) And it is not what I want.

I don't want an evaluated boolean expression... only a boolean
reference.

#if ($foo == $bleck) -> Bzzzt. Throws an error
#if ($foo > $bleck ) -> Bzzzt. Throws an error
#if ($foo) assuming foo is an instanceof Boolean, then this would be
fine.

Freemarker doesn't do that. Velocity doesn't do that. 
I must remind, I don't care how FM does or doesn't do it - this was and
is a Velocity question. If I wanted to know how I could make FM do this,
I will join the freemarker mailing lists.

Thanks,
Tim






---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Can comparisons be limited to true/false?

Posted by Attila Szegedi <sz...@freemail.hu>.
----- Original Message -----
From: "Tim Colson" <tc...@cisco.com>
To: "'Velocity Developers List'" <ve...@jakarta.apache.org>
Sent: Tuesday, July 01, 2003 10:07 PM
Subject: RE: Can comparisons be limited to true/false?


> Not according to the FM documentation I read - FM does not throw an
> exception when an IF conditional contains anytyhing other than a boolean
> reference.
>

I don't know what documentation did you read, but
http://www.freemarker.org/docs/ref_directive_if.html clearly says "The
condition-s must evaluate to a boolean value, or else an error will abort
template processing".

Regards,
  Attila.



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


RE: Architecture Overview?

Posted by Bill Chmura <Bi...@Explosivo.com>.
I think this is a pretty good idea... I'd be interested in learning
about it


-----Original Message-----
From: Tim Colson [mailto:tcolson@cisco.com] 
Sent: Tuesday, July 01, 2003 5:59 PM
To: 'Velocity Developers List'
Subject: Architecture Overview?


Say folks -
  There has been a lot of discussion about the Velocity engine. But for
me, any large piece of code (even with great Javadocs) is hard to get a
handle on by just digging around in the src.

  It would really help me, and perhaps other folks interested in working
on the core Velocity engine, to have a document that describes the
architecture and how the engine actually works. A pretty diagram or
three might be nice. ;-)

Is there already something like this for Velocity? 

Howabout using the Apache Wiki for this?

http://nagoya.apache.org/wiki/apachewiki.cgi?VelocityProjectPages
http://nagoya.apache.org/wiki/apachewiki.cgi?VelocityArchitecture

Wiki - where everyone is a committer. :-)

Thanks,
Tim



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Architecture Overview?

Posted by Tim Colson <tc...@cisco.com>.
Say folks -
  There has been a lot of discussion about the Velocity engine. But for
me, any large piece of code (even with great Javadocs) is hard to get a
handle on by just digging around in the src.

  It would really help me, and perhaps other folks interested in working
on the core Velocity engine, to have a document that describes the
architecture and how the engine actually works. A pretty diagram or
three might be nice. ;-)

Is there already something like this for Velocity? 

Howabout using the Apache Wiki for this?

http://nagoya.apache.org/wiki/apachewiki.cgi?VelocityProjectPages
http://nagoya.apache.org/wiki/apachewiki.cgi?VelocityArchitecture

Wiki - where everyone is a committer. :-)

Thanks,
Tim



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


RE: Can comparisons be limited to true/false?

Posted by Tim Colson <tc...@cisco.com>.
Jonathan wrote:
> Yeah, you anticipated it. The template engine that cannot be 
> named does work the way you want.
Not according to the FM documentation I read - FM does not throw an
exception when an IF conditional contains anytyhing other than a boolean
reference.

So I assume Jonathan's suggested code modifications might change
Velocity behaviour, but not as I described. 

Other kind readers, please do not conclude that Jonathan's post answered
my question. He is simply getting in the way of me trying to learn more
about how Velocity works.


Jonathan wrote:
> You're welcome. You've got to love it when the best available 
> authority  on the Velocity code base is...
> Yours truly,

Indeed, no thank you. And I certainly do not share Jonathan's delusion. 

> P.S. Or just use the unnameable template engine. It already works the 
> way you want. :-)
As is so often the case, Jonathan is incorrect. 

FM does -not- work the way I want. And even if it did, that would not be
enough to justify switching thousands of lines of code that use
Velocity.

Tim


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Can comparisons be limited to true/false?

Posted by Jonathan Revusky <jo...@revusky.com>.
Tim Colson wrote:
> Howdy folks -
>   I'm wondering how I might limit the comparisons in velocity templates
> to only boolean conditions.
> 
> For example:
> #if ($value > 20) HIGHLIGHTED BUTTON #else stdbutton #end
> would throw an exception and would need to be written with
> a context containing "IS_OVER_LIMIT", new Boolean() and this template:
> #if ($IS_OVER_LIMIT) HIGHLIGHTED BUTTON #else stdbutton #end
> 
> Another example:
> #if ($widget.size == "LARGE")  large #else not large #end
> would throw an exception and would need to be written as:
> #if ($widget.size.isLarge())  large #else not large #end
> 
> The question here is academic at this point. I do not care to argue
> about why this might be good/bad/weird, nor do I want to hear how it
> could be done in another engine. 

<LOL>

Yeah, you anticipated it. The template engine that cannot be named does 
work the way you want. The condition in an if must be a bona fide 
boolean. It doesn't coerce non-empty strings and whatnot into true 
etcetera. If the thing's not a boolean, it throws.

> 
> I'm just curious to know how one might go about messing with Velocity to
> alter it's behaviour as described. Maybe I'll learn something in the
> process of looking. :-)

You're in luck, Tim. I have actually been in the Velocity code to write 
the Velocity->FM template converter. The converter is actually a patched 
version of Velocity that builds up the tree using Velocity code and then 
dumps it in FreeMarker syntax.

So I know my around a bit.

The key API to look at is:

boolean 
org.apache.velocity.runtime.parser.Node.evaluate(InternalContextAdapter 
context);

This is the hook that is used to evaluate a node in the boolean if context.

To get the stricter behavior you want, you would do 2 things:

1. Patch the evaluate() method on line 334 of 
org/apache/velocity/runtime/parser/ASTReference.java so that it only 
accepts boolean values. As follows:

     public boolean evaluate( InternalContextAdapter context)
         throws MethodInvocationException
     {
         Object value = execute(null, context);

         if (value == null)
         {
             throw new MethodInvocationException("Invalid reference");
         }
         else if (value instanceof Boolean)
         {
             if (((Boolean) value).booleanValue())
                 return true;
             else
                 return false;
         }
         else
             return throw new MethodInvocationException("Cannot do a 
boolean evaluation of a non-boolean expression");
     }


2. Modify the evaluate() method on line 253 of 
org/apache/velocity/runtime/parser/SimpleNode.java
so that, instead of returning false there, it throws and exception. I 
guess it should throw MethodInvocationException, as in:

public boolean evaluate(InternalContextAdapter context)
{
//   return false; // Comment out.
    throw new MethodInvocationException("Cannot do a boolean evaluation 
of a non-boolean expression");
}

Then recompile and you should have the semantics you want.

> 
> Thanks!

You're welcome. You've got to love it when the best available authority 
on the Velocity code base is...

Yours truly,

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
Velocity->FreeMarker template conversion tool, 
http.//freemarker.org/usCavalry.html

P.S. Or just use the unnameable template engine. It already works the 
way you want. :-)

> Timo



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Can comparisons be limited to true/false?

Posted by Jonathan Revusky <jo...@revusky.com>.
Tim Colson wrote:
> Howdy folks -
>   I'm wondering how I might limit the comparisons in velocity templates
> to only boolean conditions.
> 
> For example:
> #if ($value > 20) HIGHLIGHTED BUTTON #else stdbutton #end
> would throw an exception and would need to be written with
> a context containing "IS_OVER_LIMIT", new Boolean() and this template:
> #if ($IS_OVER_LIMIT) HIGHLIGHTED BUTTON #else stdbutton #end
> 
> Another example:
> #if ($widget.size == "LARGE")  large #else not large #end
> would throw an exception and would need to be written as:
> #if ($widget.size.isLarge())  large #else not large #end
> 
> The question here is academic at this point. I do not care to argue
> about why this might be good/bad/weird, nor do I want to hear how it
> could be done in another engine. 
> 
> I'm just curious to know how one might go about messing with Velocity to
> alter it's behaviour as described. Maybe I'll learn something in the
> process of looking. :-)

Drat, I just reread your post and realized that I hadn't realized what 
you wanted. I thought you wanted strict semantics where the thing after 
an if had to be a bona fide boolean expression, and there was no 
coercion of empty strings to boolean false and that sort of nonsense. 
i.e. I thought you wanted it to work like the unnameable template engine.

You want something far far stricter. You want only boolean references to 
be available.

That's very easy too. Basically, apply the same changes I gave you in 
the last message, and also comment out or remove all the evaluate() 
methods in org/apache/velocity/runtime/parser/node/*.java except for the 
ones in:

SimpleNode.java

and:

ASTReference.java

Then you will have the semantics you want, I think.

Regards,

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
FreeMakrker-Velocity comparison page, http://freemarker.org/fmVsVel.html

> 
> Thanks!
> Timo



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org