Call a velocity macro
Hello, I have the following problem : I would like to call a macro but the macro name must be a variable. Ex: instead of #renderLabel($component) to have #call("renderLabel" $component) - of course "renderLabel" can be any (existing) macro name. I started to create a directive #call, but of course the render method fails because the nodeTree is not initialized. nodeTree is initialized during parsing like this public class ASTDirective extends SimpleNode { ... directive = rsvc.getVelocimacro( directiveName, context.getCurrentTemplateName()); try { directive.init( rsvc, context, this ); } .. { Any thoughts? I think such a directive is very useful, I don't know why is not part of the library. Thanks. CallDirective source code : public class CallDirective extends Directive { public String getName() { return "call"; } public int getType() { return LINE; } public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException { if (node.jjtGetNumChildren() < 1) { rsvc.error("#" + getName() + " : invalid number of parameters, must be at least the macro name and 0..N parameters"); return false; } String macroName = (String) node.jjtGetChild(0).value(context); VelocimacroProxy velocimacro = (VelocimacroProxy) rsvc.getVelocimacro(macroName, context.getCurrentTemplateName()); if (velocimacro == null) { rsvc.error("A macro with name '" + macroName + " in context '" + context.getCurrentTemplateName() + "' doesn't exists"); return false; } return velocimacro.render(context, writer, node); } }
RE: Call a velocity macro
Hello Take a look at the actual RenderTool (http://velocity.apache.org/tools/releases/1.4/generic/RenderTool.html). Or at the new evaluate directive, although still in developement (http://velocity.apache.org/engine/devel/vtl-reference-guide.html#aevaluate_-_dynamically_evaluates_a_string_or_reference). Etienne -Message d'origine- De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 février 2008 07:29 À : dev@velocity.apache.org Objet : Call a velocity macro Hello, I have the following problem : I would like to call a macro but the macro name must be a variable. Ex: instead of #renderLabel($component) to have #call("renderLabel" $component) - of course "renderLabel" can be any (existing) macro name. I started to create a directive #call, but of course the render method fails because the nodeTree is not initialized. nodeTree is initialized during parsing like this public class ASTDirective extends SimpleNode { ... directive = rsvc.getVelocimacro( directiveName, context.getCurrentTemplateName()); try { directive.init( rsvc, context, this ); } .. { Any thoughts? I think such a directive is very useful, I don't know why is not part of the library. Thanks. CallDirective source code : public class CallDirective extends Directive { public String getName() { return "call"; } public int getType() { return LINE; } public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException { if (node.jjtGetNumChildren() < 1) { rsvc.error("#" + getName() + " : invalid number of parameters, must be at least the macro name and 0..N parameters"); return false; } String macroName = (String) node.jjtGetChild(0).value(context); VelocimacroProxy velocimacro = (VelocimacroProxy) rsvc.getVelocimacro(macroName, context.getCurrentTemplateName()); if (velocimacro == null) { rsvc.error("A macro with name '" + macroName + " in context '" + context.getCurrentTemplateName() + "' doesn't exists"); return false; } return velocimacro.render(context, writer, node); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Adrian, Adrian Tarau wrote: I have the following problem : I would like to call a macro but the macro name must be a variable. This is more of a question for the user's list, not the dev list. In the future, please post there. Ex: instead of #renderLabel($component) to have #call("renderLabel" $component) - of course "renderLabel" can be any (existing) macro name. How many possibilities can you have for $component? Are they unlimited, or constrained to maybe 5 possibilities? I'm wondering because you could easily do it like a switch: #if('renderLabel' == $macroToCall) #renderLabel($component) #elseif('renderInput' == $macroToCall) #renderInput($component) #elseif(...) ... #end -chris signature.asc Description: OpenPGP digital signature
Re: Call a velocity macro
Velocity.evaluate or Velocity.invokeVelocimacro(which calls evaluate) doesn't provide support to pass objects as parameters and is not suitable to be called from a template. The new directive #evaluate is actually Velocity.evaluate. It is still an evaluate, which means expression parsing. I would like to avoid that. If you will call "call/invoke" directive too often I think it will perform badly, due the fact that a parsing step is performed. In this case, a call to a velocity macro, we don't need the parsing step. We know the "expression", and what we need is to prepare the node without parsing.I don't know much about the velocity internals, but I presume it should be possible. And I think such a directive should be part of the core, I mean it will be easy to implement a "switch"(is what I need actually) based on some variable. Like in my case : #macro(renderLabel $component) #end #macro(renderTextField $component) #end #macro(renderRadioButton $component) #end . #call('render'+$component.type $component) where 'type' is 'label', 'text-field', 'radio-button'(of course there is a normalization of the type value, first character upper case, '-' makes the next character uppercase, etc). Instead of lots of tests with #if, it will be better(and faster) to have this 'switch'.At least it looks better, the template is cleaner and it is (it will be)also faster. Thanks. /Reader reader = *new* BufferedReader(*new* StringReader(sourceText)); String templateName = context.getCurrentTemplateName(); SimpleNode nodeTree = *null*; *try* { *nodeTree* = rsvc.parse(reader, templateName); } *catch* (ParseException pex) { use the line/column from the template Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage(), info ); } *catch* (TemplateInitException pex) { Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage(), info ); }/ Massip, Etienne wrote: Hello Take a look at the actual RenderTool (http://velocity.apache.org/tools/releases/1.4/generic/RenderTool.html). Or at the new evaluate directive, although still in developement (http://velocity.apache.org/engine/devel/vtl-reference-guide.html#aevaluate_-_dynamically_evaluates_a_string_or_reference). Etienne -Message d'origine----- De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 février 2008 07:29 À : dev@velocity.apache.org Objet : Call a velocity macro Hello, I have the following problem : I would like to call a macro but the macro name must be a variable. Ex: instead of #renderLabel($component) to have #call("renderLabel" $component) - of course "renderLabel" can be any (existing) macro name. I started to create a directive #call, but of course the render method fails because the nodeTree is not initialized. nodeTree is initialized during parsing like this public class ASTDirective extends SimpleNode { ... directive = rsvc.getVelocimacro( directiveName, context.getCurrentTemplateName()); try { directive.init( rsvc, context, this ); } .. { Any thoughts? I think such a directive is very useful, I don't know why is not part of the library. Thanks. CallDirective source code : public class CallDirective extends Directive { public String getName() { return "call"; } public int getType() { return LINE; } public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException { if (node.jjtGetNumChildren() < 1) { rsvc.error("#" + getName() + " : invalid number of parameters, must be at least the macro name and 0..N parameters"); return false; } String macroName = (String) node.jjtGetChild(0).value(context); VelocimacroProxy velocimacro = (VelocimacroProxy) rsvc.getVelocimacro(macroName, context.getCurrentTemplateName()); if (velocimacro == null) { rsvc.error("A macro with name '" + macroName + " in context '" + context.getCurrentTemplateName() + "' doesn't exists"); return false; } return velocimacro.render(context, writer, node); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
I've always used #if to implement the 'switch' but I think, even for 3-4 conditions, the template will look cleaner. Instead of #if('renderLabel' == $macroToCall) #renderLabel($component) #elseif('renderInput' == $macroToCall) #renderInput($component) #elseif(...) ... #end we will have #call($macroToCall $component). In case of a value outside the 'domain' you will get an exception "Macro not found ". We could have even a directive which will simulate the switch default branch. #callWithDefault($macroToCall $defaultMacro ) - of course the name should be shorter. Christopher Schultz wrote: Adrian, Adrian Tarau wrote: I have the following problem : I would like to call a macro but the macro name must be a variable. This is more of a question for the user's list, not the dev list. In the future, please post there. Ex: instead of #renderLabel($component) to have #call("renderLabel" $component) - of course "renderLabel" can be any (existing) macro name. How many possibilities can you have for $component? Are they unlimited, or constrained to maybe 5 possibilities? I'm wondering because you could easily do it like a switch: #if('renderLabel' == $macroToCall) #renderLabel($component) #elseif('renderInput' == $macroToCall) #renderInput($component) #elseif(...) ... #end -chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Even if the expression passed to evaluate is small, it will still go to a JavaCC parser, means the call is overloaded with unnecessary operations. Unnecessary because there is no expression involved here, the macro parameters are already in the node parameter when /public boolean render( InternalContextAdapter context, Writer writer, Node node)/ is invoked for the #call directive. In a custom directive you can always get a reference to a macro with /VelocimacroProxy velocimacro = (VelocimacroProxy) rsvc.getVelocimacro(macroName, context.getCurrentTemplateName());/ but this is not initialized. If you call 'render' it will throw a NPE since nodeTree is initialized by init(). A VelocimacroProxy is initialized during parsing, when the parser finds #XXX(...), but in this case I should initialize the macro before the call. The problem is, calling init will bring a parsing operation of the macro body(every time when a call is done). It's not clear for me, I don't have the big picture, but it seems Velocity it is optimized for early binding, when a template is "compiled" it knows exactly what to call to apply the template as faster as possible. Massip, Etienne wrote: A dynamic call of a parameter-given name is a minimal parsing, but still is, preventing any kind of "compile-time linkage" from being done. The "expression" seems to be known only at template-parsing-time, isn't it ? I think #call('render'+$component.type $component) makes very little difference with #evaluate('#render' + $component.type + '($component)') If the evaluate directive really performs poorly, then maybe it should be a good idea to speed it up other than create a new and specialized one ? -Message d'origine- De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 février 2008 16:14 À : Velocity Developers List Objet : Re: Call a velocity macro Velocity.evaluate or Velocity.invokeVelocimacro(which calls evaluate) doesn't provide support to pass objects as parameters and is not suitable to be called from a template. The new directive #evaluate is actually Velocity.evaluate. It is still an evaluate, which means expression parsing. I would like to avoid that. If you will call "call/invoke" directive too often I think it will perform badly, due the fact that a parsing step is performed. In this case, a call to a velocity macro, we don't need the parsing step. We know the "expression", and what we need is to prepare the node without parsing.I don't know much about the velocity internals, but I presume it should be possible. And I think such a directive should be part of the core, I mean it will be easy to implement a "switch"(is what I need actually) based on some variable. Like in my case : #macro(renderLabel $component) #end #macro(renderTextField $component) #end #macro(renderRadioButton $component) #end . #call('render'+$component.type $component) where 'type' is 'label', 'text-field', 'radio-button'(of course there is a normalization of the type value, first character upper case, '-' makes the next character uppercase, etc). Instead of lots of tests with #if, it will be better(and faster) to have this 'switch'.At least it looks better, the template is cleaner and it is (it will be)also faster. Thanks. /Reader reader = *new* BufferedReader(*new* StringReader(sourceText)); String templateName = context.getCurrentTemplateName(); SimpleNode nodeTree = *null*; *try* { *nodeTree* = rsvc.parse(reader, templateName); } *catch* (ParseException pex) { use the line/column from the template Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage(), info ); } *catch* (TemplateInitException pex) { Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage(), info ); }/ Massip, Etienne wrote: Hello Take a look at the actual RenderTool (http://velocity.apache.org/tools/releases/1.4/generic/RenderTool.html). Or at the new evaluate directive, although still in developement (http://velocity.apache.org/engine/devel/vtl-reference-guide.html#aevaluate_-_dynamically_evaluates_a_string_or_reference). Etienne -Message d'origine- De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 février 2008 07:29 À : dev@velocity.apache.org Objet : Call a velocity macro Hello, I have the following problem : I would like to call a macro but the macro name must be a variable. Ex: instead of #renderLabel($component) to have #call("renderLabel" $co
Re: Call a velocity macro
Adrian, Adrian Tarau wrote: I think it is a question for the dev's list, since it involves creating a new feature - a new directive - (or asking about velocity internals).Is not a question about how to use velocity. My bad if I'm mistaken. I suppose it could go either way. I see this as asking if there's a good way to do what you're trying to do. It may not actually need a code change. Of course, what you /proposed/ requires code changes, but perhaps there's a way to do it another way... The possibilities are limited by default, around 12(the standard Swing components), but the infrastructure is flexible so any time a new component type can be plugged in(the component factory registers a new #macro for every component type). I would like to avoid those calling #if 12 times and anyway, it breaks the plug&play model. If your component factory registers new macros when new component types are added, perhaps you could have that same factory register a macro that does your 12-way check. Something like this: #renderComponent($component) #if($component.type == 'label') ... #elseif($component.type == 'whatever') ... #end## switch(component.type) #end## macro renderComponent Then, in your templates, you always use: #renderComponent($component) Your templates are clean, your infrastructure takes care of the messiness, and the devs here don't have to figure out how to retrofit the Velocity language parser to allow for something like: #('render' + $component.type)($component) Another alternative might be to use a "tool" instead of a directive. But that gets back to why Velocity.invokeVelocimacro won't work for you (why doesn't it work, again?). -chris signature.asc Description: OpenPGP digital signature
Re: Call a velocity macro
Adrian, Adrian Tarau wrote: What I need is more like calling a template as a function(which behave like a function) in the context of the current execution context(same context, same writer) without too much overhead. I will try to implement something like that and I will publish the result, maybe it will be useful for somebody else. I'm thinking that a "tool" is what you're looking for. Since you know what methods you want to call in Velocity -- it's just a matter of calling /them/ instead of something else (like "evaluate"), you could easily write a tool that takes a series of arguments (sounds like you just need the name of the macro to call and a list of arguments of unspecified type) and simply invokes the template with the name matching the first argument. Since the tool's method is invoked after the Velocity engine resolves the name (i.e. concatenates the string "render" with the name of the component), you can probably write a 1-liner that will do what you want. -chris signature.asc Description: OpenPGP digital signature
RE: Call a velocity macro
A dynamic call of a parameter-given name is a minimal parsing, but still is, preventing any kind of "compile-time linkage" from being done. The "expression" seems to be known only at template-parsing-time, isn't it ? I think #call('render'+$component.type $component) makes very little difference with #evaluate('#render' + $component.type + '($component)') If the evaluate directive really performs poorly, then maybe it should be a good idea to speed it up other than create a new and specialized one ? -Message d'origine- De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 février 2008 16:14 À : Velocity Developers List Objet : Re: Call a velocity macro Velocity.evaluate or Velocity.invokeVelocimacro(which calls evaluate) doesn't provide support to pass objects as parameters and is not suitable to be called from a template. The new directive #evaluate is actually Velocity.evaluate. It is still an evaluate, which means expression parsing. I would like to avoid that. If you will call "call/invoke" directive too often I think it will perform badly, due the fact that a parsing step is performed. In this case, a call to a velocity macro, we don't need the parsing step. We know the "expression", and what we need is to prepare the node without parsing.I don't know much about the velocity internals, but I presume it should be possible. And I think such a directive should be part of the core, I mean it will be easy to implement a "switch"(is what I need actually) based on some variable. Like in my case : #macro(renderLabel $component) #end #macro(renderTextField $component) #end #macro(renderRadioButton $component) #end . #call('render'+$component.type $component) where 'type' is 'label', 'text-field', 'radio-button'(of course there is a normalization of the type value, first character upper case, '-' makes the next character uppercase, etc). Instead of lots of tests with #if, it will be better(and faster) to have this 'switch'.At least it looks better, the template is cleaner and it is (it will be)also faster. Thanks. /Reader reader = *new* BufferedReader(*new* StringReader(sourceText)); String templateName = context.getCurrentTemplateName(); SimpleNode nodeTree = *null*; *try* { *nodeTree* = rsvc.parse(reader, templateName); } *catch* (ParseException pex) { use the line/column from the template Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage(), info ); } *catch* (TemplateInitException pex) { Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage(), info ); }/ Massip, Etienne wrote: > Hello > > Take a look at the actual RenderTool > (http://velocity.apache.org/tools/releases/1.4/generic/RenderTool.html). > > Or at the new evaluate directive, although still in developement > (http://velocity.apache.org/engine/devel/vtl-reference-guide.html#aevaluate_-_dynamically_evaluates_a_string_or_reference). > > Etienne > > -Message d'origine- > De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 > février 2008 07:29 À : dev@velocity.apache.org Objet : Call a velocity > macro > > Hello, > > > > I have the following problem : I would like to call a macro but the macro > name must be a variable. > > > > Ex: instead of #renderLabel($component) to have #call("renderLabel" > $component) - of course "renderLabel" can be any (existing) macro name. > > > > I started to create a directive #call, but of course the render method > fails because the nodeTree is not initialized. nodeTree is initialized > during parsing like this > > > > public class ASTDirective extends SimpleNode { > > > > ... > >directive = rsvc.getVelocimacro( directiveName, > context.getCurrentTemplateName()); > > > > try > > { > > directive.init( rsvc, context, this ); > > } > > > > .. > > { > > > > > > Any thoughts? I think such a directive is very useful, I don't know why is > not part of the library. > > Thanks. > > > > CallDirective source code : > > > > public class CallDirective extends Directive { > > > > public String getName() { > > return "call"; > > } > > &g
Re: Call a velocity macro
Christopher, I think it is a question for the dev's list, since it involves creating a new feature - a new directive - (or asking about velocity internals).Is not a question about how to use velocity. My bad if I'm mistaken. The possibilities are limited by default, around 12(the standard Swing components), but the infrastructure is flexible so any time a new component type can be pluged in(the component factory registers a new #macro for every component type). I would like to avoid those calling #if 12 times and anyway, it breaks the plug&play model. Thanks. Christopher Schultz wrote: Adrian, Adrian Tarau wrote: I have the following problem : I would like to call a macro but the macro name must be a variable. This is more of a question for the user's list, not the dev list. In the future, please post there. Ex: instead of #renderLabel($component) to have #call("renderLabel" $component) - of course "renderLabel" can be any (existing) macro name. How many possibilities can you have for $component? Are they unlimited, or constrained to maybe 5 possibilities? I'm wondering because you could easily do it like a switch: #if('renderLabel' == $macroToCall) #renderLabel($component) #elseif('renderInput' == $macroToCall) #renderInput($component) #elseif(...) ... #end -chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
I've always imagined a macro as a function, but as the name says, the macro body is expanded at parsing time in the current template. This has the advantage to have the template tree in memory and the rendering speed is the fastest possible. What I need is more like calling a template as a function(which behave like a function) in the context of the current execution context(same context, same writer) without too much overhead. I will try to implement something like that and I will publish the result, maybe it will be useful for somebody else. Thanks. Massip, Etienne wrote: A dynamic call of a parameter-given name is a minimal parsing, but still is, preventing any kind of "compile-time linkage" from being done. The "expression" seems to be known only at template-parsing-time, isn't it ? I think #call('render'+$component.type $component) makes very little difference with #evaluate('#render' + $component.type + '($component)') If the evaluate directive really performs poorly, then maybe it should be a good idea to speed it up other than create a new and specialized one ? -Message d'origine- De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 février 2008 16:14 À : Velocity Developers List Objet : Re: Call a velocity macro Velocity.evaluate or Velocity.invokeVelocimacro(which calls evaluate) doesn't provide support to pass objects as parameters and is not suitable to be called from a template. The new directive #evaluate is actually Velocity.evaluate. It is still an evaluate, which means expression parsing. I would like to avoid that. If you will call "call/invoke" directive too often I think it will perform badly, due the fact that a parsing step is performed. In this case, a call to a velocity macro, we don't need the parsing step. We know the "expression", and what we need is to prepare the node without parsing.I don't know much about the velocity internals, but I presume it should be possible. And I think such a directive should be part of the core, I mean it will be easy to implement a "switch"(is what I need actually) based on some variable. Like in my case : #macro(renderLabel $component) #end #macro(renderTextField $component) #end #macro(renderRadioButton $component) #end . #call('render'+$component.type $component) where 'type' is 'label', 'text-field', 'radio-button'(of course there is a normalization of the type value, first character upper case, '-' makes the next character uppercase, etc). Instead of lots of tests with #if, it will be better(and faster) to have this 'switch'.At least it looks better, the template is cleaner and it is (it will be)also faster. Thanks. /Reader reader = *new* BufferedReader(*new* StringReader(sourceText)); String templateName = context.getCurrentTemplateName(); SimpleNode nodeTree = *null*; *try* { *nodeTree* = rsvc.parse(reader, templateName); } *catch* (ParseException pex) { use the line/column from the template Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage(), info ); } *catch* (TemplateInitException pex) { Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage(), info ); }/ Massip, Etienne wrote: Hello Take a look at the actual RenderTool (http://velocity.apache.org/tools/releases/1.4/generic/RenderTool.html). Or at the new evaluate directive, although still in developement (http://velocity.apache.org/engine/devel/vtl-reference-guide.html#aevaluate_-_dynamically_evaluates_a_string_or_reference). Etienne -Message d'origine- De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 février 2008 07:29 À : dev@velocity.apache.org Objet : Call a velocity macro Hello, I have the following problem : I would like to call a macro but the macro name must be a variable. Ex: instead of #renderLabel($component) to have #call("renderLabel" $component) - of course "renderLabel" can be any (existing) macro name. I started to create a directive #call, but of course the render method fails because the nodeTree is not initialized. nodeTree is initialized during parsing like this public class ASTDirective extends SimpleNode { ... directive = rsvc.getVelocimacro( directiveName, context.getCurrentTemplateName()); try { directive.init( rsvc, context, this ); } .. { Any thoughts? I think such a directive is very useful, I don't know why is not part of the lib
Re: Call a velocity macro
In this particular case, the component factory knows the component types and it can "inject" a global template with all the rendering templates + 1 which makes the switch. However, I think it will be useful to have the possibility to register templates as function and be able to call(with a directive called #function or #invoke) them with the current template context. It is just a matter of wrapping the current context with a different one, override the function parameters in the context, render the function template in the current Writer. There will be some overhead(preparing the new context, and merge the template), but the feature will benefit of function reload on change(since is a template) and will allow dynamic calling of a template. In my case, since I want to be as fast as possible, I will generate the macros but I will give it a try and implement also the function way. I will do a benchmark to see how much overhead I will add with this approach. Thanks for your support. Christopher Schultz wrote: Adrian, Adrian Tarau wrote: I think it is a question for the dev's list, since it involves creating a new feature - a new directive - (or asking about velocity internals).Is not a question about how to use velocity. My bad if I'm mistaken. I suppose it could go either way. I see this as asking if there's a good way to do what you're trying to do. It may not actually need a code change. Of course, what you /proposed/ requires code changes, but perhaps there's a way to do it another way... The possibilities are limited by default, around 12(the standard Swing components), but the infrastructure is flexible so any time a new component type can be plugged in(the component factory registers a new #macro for every component type). I would like to avoid those calling #if 12 times and anyway, it breaks the plug&play model. If your component factory registers new macros when new component types are added, perhaps you could have that same factory register a macro that does your 12-way check. Something like this: #renderComponent($component) #if($component.type == 'label') ... #elseif($component.type == 'whatever') ... #end## switch(component.type) #end## macro renderComponent Then, in your templates, you always use: #renderComponent($component) Your templates are clean, your infrastructure takes care of the messiness, and the devs here don't have to figure out how to retrofit the Velocity language parser to allow for something like: #('render' + $component.type)($component) Another alternative might be to use a "tool" instead of a directive. But that gets back to why Velocity.invokeVelocimacro won't work for you (why doesn't it work, again?). -chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Hi Adrian, in a similar scenario I use the #parse directive and placed the code snippets (aka. macros) into a *.vtl file each. Something like: #set( $component = ... ) #set( $type = $component.type ) #parse("renderComponent${type}.vtl" ) This has the advantage, that these rendering Templates parsed once and cached. The downside is that the parameter passing is implicit (here $component is the input parameter for the parsed template) and that these parsed templates must be careful not to overwrite existing variables. For this I used a different namespace (postfixed variables with "_"), but you can also use the new #local directive to avoid conflicts. Cheers, Christoph Adrian Tarau wrote: I've always imagined a macro as a function, but as the name says, the macro body is expanded at parsing time in the current template. This has the advantage to have the template tree in memory and the rendering speed is the fastest possible. What I need is more like calling a template as a function(which behave like a function) in the context of the current execution context(same context, same writer) without too much overhead. I will try to implement something like that and I will publish the result, maybe it will be useful for somebody else. Thanks. Massip, Etienne wrote: A dynamic call of a parameter-given name is a minimal parsing, but still is, preventing any kind of "compile-time linkage" from being done. The "expression" seems to be known only at template-parsing-time, isn't it ? I think #call('render'+$component.type $component) makes very little difference with #evaluate('#render' + $component.type + '($component)') If the evaluate directive really performs poorly, then maybe it should be a good idea to speed it up other than create a new and specialized one ? -Message d'origine- De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 février 2008 16:14 À : Velocity Developers List Objet : Re: Call a velocity macro Velocity.evaluate or Velocity.invokeVelocimacro(which calls evaluate) doesn't provide support to pass objects as parameters and is not suitable to be called from a template. The new directive #evaluate is actually Velocity.evaluate. It is still an evaluate, which means expression parsing. I would like to avoid that. If you will call "call/invoke" directive too often I think it will perform badly, due the fact that a parsing step is performed. In this case, a call to a velocity macro, we don't need the parsing step. We know the "expression", and what we need is to prepare the node without parsing.I don't know much about the velocity internals, but I presume it should be possible. And I think such a directive should be part of the core, I mean it will be easy to implement a "switch"(is what I need actually) based on some variable. Like in my case : #macro(renderLabel $component) #end #macro(renderTextField $component) #end #macro(renderRadioButton $component) #end . #call('render'+$component.type $component) where 'type' is 'label', 'text-field', 'radio-button'(of course there is a normalization of the type value, first character upper case, '-' makes the next character uppercase, etc). Instead of lots of tests with #if, it will be better(and faster) to have this 'switch'.At least it looks better, the template is cleaner and it is (it will be)also faster. Thanks. /Reader reader = *new* BufferedReader(*new* StringReader(sourceText)); String templateName = context.getCurrentTemplateName(); SimpleNode nodeTree = *null*; *try* { *nodeTree* = rsvc.parse(reader, templateName); } *catch* (ParseException pex) { use the line/column from the template Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage(), info ); } *catch* (TemplateInitException pex) { Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage(), info ); }/ Massip, Etienne wrote: Hello Take a look at the actual RenderTool (http://velocity.apache.org/tools/releases/1.4/generic/RenderTool.html). Or at the new evaluate directive, although still in developement (http://velocity.apache.org/engine/devel/vtl-reference-guide.html#aevaluate_-_dynamically_evaluates_a_string_or_reference). Etienne -Message d'origine- De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 février 2008 07:29 À : dev@velocity.apache.org Objet : Call a velocity macro Hello, I have the following problem : I would like to call a macro but t
Re: Call a velocity macro
Thanks, I think I will implement a different directive, based on #parse but passing the parameters & having all the variables local to the "function". I'm not aware of any directive called #local. What do you mean? [EMAIL PROTECTED] wrote: Hi Adrian, in a similar scenario I use the #parse directive and placed the code snippets (aka. macros) into a *.vtl file each. Something like: #set( $component = ... ) #set( $type = $component.type ) #parse("renderComponent${type}.vtl" ) This has the advantage, that these rendering Templates parsed once and cached. The downside is that the parameter passing is implicit (here $component is the input parameter for the parsed template) and that these parsed templates must be careful not to overwrite existing variables. For this I used a different namespace (postfixed variables with "_"), but you can also use the new #local directive to avoid conflicts. Cheers, Christoph Adrian Tarau wrote: I've always imagined a macro as a function, but as the name says, the macro body is expanded at parsing time in the current template. This has the advantage to have the template tree in memory and the rendering speed is the fastest possible. What I need is more like calling a template as a function(which behave like a function) in the context of the current execution context(same context, same writer) without too much overhead. I will try to implement something like that and I will publish the result, maybe it will be useful for somebody else. Thanks. Massip, Etienne wrote: A dynamic call of a parameter-given name is a minimal parsing, but still is, preventing any kind of "compile-time linkage" from being done. The "expression" seems to be known only at template-parsing-time, isn't it ? I think #call('render'+$component.type $component) makes very little difference with #evaluate('#render' + $component.type + '($component)') If the evaluate directive really performs poorly, then maybe it should be a good idea to speed it up other than create a new and specialized one ? -Message d'origine- De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 février 2008 16:14 À : Velocity Developers List Objet : Re: Call a velocity macro Velocity.evaluate or Velocity.invokeVelocimacro(which calls evaluate) doesn't provide support to pass objects as parameters and is not suitable to be called from a template. The new directive #evaluate is actually Velocity.evaluate. It is still an evaluate, which means expression parsing. I would like to avoid that. If you will call "call/invoke" directive too often I think it will perform badly, due the fact that a parsing step is performed. In this case, a call to a velocity macro, we don't need the parsing step. We know the "expression", and what we need is to prepare the node without parsing.I don't know much about the velocity internals, but I presume it should be possible. And I think such a directive should be part of the core, I mean it will be easy to implement a "switch"(is what I need actually) based on some variable. Like in my case : #macro(renderLabel $component) #end #macro(renderTextField $component) #end #macro(renderRadioButton $component) #end . #call('render'+$component.type $component) where 'type' is 'label', 'text-field', 'radio-button'(of course there is a normalization of the type value, first character upper case, '-' makes the next character uppercase, etc). Instead of lots of tests with #if, it will be better(and faster) to have this 'switch'.At least it looks better, the template is cleaner and it is (it will be)also faster. Thanks. /Reader reader = *new* BufferedReader(*new* StringReader(sourceText)); String templateName = context.getCurrentTemplateName(); SimpleNode nodeTree = *null*; *try* { *nodeTree* = rsvc.parse(reader, templateName); } *catch* (ParseException pex) { use the line/column from the template Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage(), info ); } *catch* (TemplateInitException pex) { Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage(), info ); }/ Massip, Etienne wrote: Hello Take a look at the actual RenderTool (http://velocity.apache.org/tools/releases/1.4/generic/RenderTool.html). Or at the new evaluate directive, although still in developement (http://velocity.apache.org/engine/devel/vtl-reference-guide.html#aevaluate_-_dynamically_evaluates_a_string_or_reference). Etienne -Message d'origin
Re: Call a velocity macro
I'm pretty sure #local is still just in Geir's whiteboard section. No one has ever gotten it promoted out of there. I've never been opposed to it, but i've also never been interested in putting the work needed into it (tests, docs, etc). http://svn.apache.org/repos/asf/velocity/engine/trunk/whiteboard/geir/Local.java On Wed, Feb 20, 2008 at 2:09 PM, Adrian Tarau <[EMAIL PROTECTED]> wrote: > Thanks, > > I think I will implement a different directive, based on #parse but > passing the parameters & having all the variables local to the "function". > I'm not aware of any directive called #local. What do you mean? > > > > [EMAIL PROTECTED] wrote: > > Hi Adrian, > > > > in a similar scenario I use the #parse directive and placed the code > > snippets (aka. macros) into a *.vtl file each. Something like: > > > > #set( $component = ... ) > > #set( $type = $component.type ) > > #parse("renderComponent${type}.vtl" ) > > > > This has the advantage, that these rendering Templates parsed once and > > cached. > > > > The downside is that the parameter passing is implicit (here > > $component is the input parameter for the parsed template) and that > > these parsed templates must be careful not to overwrite existing > > variables. For this I used a different namespace (postfixed variables > > with "_"), but you can also use the new #local directive to avoid > > conflicts. > > > > Cheers, > > Christoph > > > > Adrian Tarau wrote: > >> I've always imagined a macro as a function, but as the name says, the > >> macro body is expanded at parsing time in the current template. This > >> has the advantage to have the template tree in memory and the > >> rendering speed is the fastest possible. > >> > >> What I need is more like calling a template as a function(which > >> behave like a function) in the context of the current execution > >> context(same context, same writer) without too much overhead. > >> > >> I will try to implement something like that and I will publish the > >> result, maybe it will be useful for somebody else. > >> > >> Thanks. > >> > >> Massip, Etienne wrote: > >>> A dynamic call of a parameter-given name is a minimal parsing, but > >>> still is, preventing any kind of "compile-time linkage" from being > >>> done. > >>> > >>> The "expression" seems to be known only at template-parsing-time, > >>> isn't it ? > >>> > >>> I think > >>> > >>> #call('render'+$component.type $component) > >>> > >>> makes very little difference with > >>> > >>> #evaluate('#render' + $component.type + '($component)') > >>> > >>> If the evaluate directive really performs poorly, then maybe it > >>> should be a good idea to speed it up other than create a new and > >>> specialized one ? > >>> > >>> -Message d'origine- > >>> De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 > >>> février 2008 16:14 > >>> À : Velocity Developers List > >>> Objet : Re: Call a velocity macro > >>> > >>> Velocity.evaluate or Velocity.invokeVelocimacro(which calls > >>> evaluate) doesn't provide support to pass objects as parameters and > >>> is not suitable to be called from a template. > >>> > >>> The new directive #evaluate is actually Velocity.evaluate. It is > >>> still an evaluate, which means expression parsing. I would like to > >>> avoid that. If you will call "call/invoke" directive too often I > >>> think it will perform badly, due the fact that a parsing step is > >>> performed. > >>> > >>> In this case, a call to a velocity macro, we don't need the parsing > >>> step. We know the "expression", and what we need is to prepare the > >>> node without parsing.I don't know much about the velocity internals, > >>> but I presume it should be possible. > >>> And I think such a directive should be part of the core, I mean it > >>> will be easy to implement a "switch"(is what I need actually) based > >>> on some variable. Like in my case : > >>> > >>> #macro(r
Re: Call a velocity macro
There was something really sucky about it, which is why I didn't move it forward. I forget why it was bad... geir On Feb 20, 2008, at 5:16 PM, Nathan Bubna wrote: I'm pretty sure #local is still just in Geir's whiteboard section. No one has ever gotten it promoted out of there. I've never been opposed to it, but i've also never been interested in putting the work needed into it (tests, docs, etc). http://svn.apache.org/repos/asf/velocity/engine/trunk/whiteboard/geir/Local.java On Wed, Feb 20, 2008 at 2:09 PM, Adrian Tarau <[EMAIL PROTECTED]> wrote: Thanks, I think I will implement a different directive, based on #parse but passing the parameters & having all the variables local to the "function". I'm not aware of any directive called #local. What do you mean? [EMAIL PROTECTED] wrote: Hi Adrian, in a similar scenario I use the #parse directive and placed the code snippets (aka. macros) into a *.vtl file each. Something like: #set( $component = ... ) #set( $type = $component.type ) #parse("renderComponent${type}.vtl" ) This has the advantage, that these rendering Templates parsed once and cached. The downside is that the parameter passing is implicit (here $component is the input parameter for the parsed template) and that these parsed templates must be careful not to overwrite existing variables. For this I used a different namespace (postfixed variables with "_"), but you can also use the new #local directive to avoid conflicts. Cheers, Christoph Adrian Tarau wrote: I've always imagined a macro as a function, but as the name says, the macro body is expanded at parsing time in the current template. This has the advantage to have the template tree in memory and the rendering speed is the fastest possible. What I need is more like calling a template as a function(which behave like a function) in the context of the current execution context(same context, same writer) without too much overhead. I will try to implement something like that and I will publish the result, maybe it will be useful for somebody else. Thanks. Massip, Etienne wrote: A dynamic call of a parameter-given name is a minimal parsing, but still is, preventing any kind of "compile-time linkage" from being done. The "expression" seems to be known only at template-parsing-time, isn't it ? I think #call('render'+$component.type $component) makes very little difference with #evaluate('#render' + $component.type + '($component)') If the evaluate directive really performs poorly, then maybe it should be a good idea to speed it up other than create a new and specialized one ? -Message d'origine----- De : Adrian Tarau [mailto:[EMAIL PROTECTED] Envoyé : mardi 19 février 2008 16:14 À : Velocity Developers List Objet : Re: Call a velocity macro Velocity.evaluate or Velocity.invokeVelocimacro(which calls evaluate) doesn't provide support to pass objects as parameters and is not suitable to be called from a template. The new directive #evaluate is actually Velocity.evaluate. It is still an evaluate, which means expression parsing. I would like to avoid that. If you will call "call/invoke" directive too often I think it will perform badly, due the fact that a parsing step is performed. In this case, a call to a velocity macro, we don't need the parsing step. We know the "expression", and what we need is to prepare the node without parsing.I don't know much about the velocity internals, but I presume it should be possible. And I think such a directive should be part of the core, I mean it will be easy to implement a "switch"(is what I need actually) based on some variable. Like in my case : #macro(renderLabel $component) #end #macro(renderTextField $component) #end #macro(renderRadioButton $component) #end . #call('render'+$component.type $component) where 'type' is 'label', 'text-field', 'radio-button'(of course there is a normalization of the type value, first character upper case, '-' makes the next character uppercase, etc). Instead of lots of tests with #if, it will be better(and faster) to have this 'switch'.At least it looks better, the template is cleaner and it is (it will be)also faster. Thanks. /Reader reader = *new* BufferedReader(*new* StringReader(sourceText)); String templateName = context.getCurrentTemplateName(); SimpleNode nodeTree = *null*; *try* { *nodeTree* = rsvc.parse(reader, templateName); } *catch* (ParseException pex) { use the line/column from the template Info info = *new* Info( templateName, node.getLine(), node.getColumn() ); *throw* *new* ParseErrorException( pex.getMessage
Re: Call a velocity macro
Christoph, [EMAIL PROTECTED] wrote: For this I used a different namespace (postfixed variables with "_"), but you can also use the new #local directive to avoid conflicts. I don't see #local in the documentation. Could you point me to it? -chris signature.asc Description: OpenPGP digital signature
Re: Call a velocity macro
On Wed, Feb 20, 2008 at 2:18 PM, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote: > There was something really sucky about it, which is why I didn't move > it forward. I forget why it was bad... Hmm. Well, that's a good reason to wait for some good test code for it before we consider promotion... > geir Btw, Geir, did you ever find that old code you had for escaping quotes in strings? (https://issues.apache.org/jira/browse/VELOCITY-555) If not, do you remember the gist of how you implemented it? I'm interested in taking a stab at this before pushing an Engine 1.6 release, but i'm not sure how to do it. > > > On Feb 20, 2008, at 5:16 PM, Nathan Bubna wrote: > > > I'm pretty sure #local is still just in Geir's whiteboard section. No > > one has ever gotten it promoted out of there. I've never been opposed > > to it, but i've also never been interested in putting the work needed > > into it (tests, docs, etc). > > > > > http://svn.apache.org/repos/asf/velocity/engine/trunk/whiteboard/geir/Local.java > > > > On Wed, Feb 20, 2008 at 2:09 PM, Adrian Tarau > > <[EMAIL PROTECTED]> wrote: > >> Thanks, > >> > >> I think I will implement a different directive, based on #parse but > >> passing the parameters & having all the variables local to the > >> "function". > >> I'm not aware of any directive called #local. What do you mean? > >> > >> > >> > >> [EMAIL PROTECTED] wrote: > >>> Hi Adrian, > >>> > >>> in a similar scenario I use the #parse directive and placed the code > >>> snippets (aka. macros) into a *.vtl file each. Something like: > >>> > >>> #set( $component = ... ) > >>> #set( $type = $component.type ) > >>> #parse("renderComponent${type}.vtl" ) > >>> > >>> This has the advantage, that these rendering Templates parsed once > >>> and > >>> cached. > >>> > >>> The downside is that the parameter passing is implicit (here > >>> $component is the input parameter for the parsed template) and that > >>> these parsed templates must be careful not to overwrite existing > >>> variables. For this I used a different namespace (postfixed > >>> variables > >>> with "_"), but you can also use the new #local directive to avoid > >>> conflicts. > >>> > >>> Cheers, > >>> Christoph > >>> > >>> Adrian Tarau wrote: > >>>> I've always imagined a macro as a function, but as the name says, > >>>> the > >>>> macro body is expanded at parsing time in the current template. > >>>> This > >>>> has the advantage to have the template tree in memory and the > >>>> rendering speed is the fastest possible. > >>>> > >>>> What I need is more like calling a template as a function(which > >>>> behave like a function) in the context of the current execution > >>>> context(same context, same writer) without too much overhead. > >>>> > >>>> I will try to implement something like that and I will publish the > >>>> result, maybe it will be useful for somebody else. > >>>> > >>>> Thanks. > >>>> > >>>> Massip, Etienne wrote: > >>>>> A dynamic call of a parameter-given name is a minimal parsing, but > >>>>> still is, preventing any kind of "compile-time linkage" from being > >>>>> done. > >>>>> > >>>>> The "expression" seems to be known only at template-parsing-time, > >>>>> isn't it ? > >>>>> > >>>>> I think > >>>>> > >>>>> #call('render'+$component.type $component) > >>>>> > >>>>> makes very little difference with > >>>>> > >>>>> #evaluate('#render' + $component.type + '($component)') > >>>>> > >>>>> If the evaluate directive really performs poorly, then maybe it > >>>>> should be a good idea to speed it up other than create a new and > >>>>> specialized one ? > >>>>> > >>>>> -Message d'origine- > >>>>> De :
Re: Call a velocity macro
Nathan, Nathan Bubna wrote: I'm pretty sure #local is still just in Geir's whiteboard section. No one has ever gotten it promoted out of there. I've never been opposed to it, but i've also never been interested in putting the work needed into it (tests, docs, etc). I have to admit that when I started really writing macros (other than super simple ones), I was disappointed to learn that there was no "stack"... that is, I couldn't implement certain things properly using the macro facility because recursive calls would overwrite variables from what I would have considered "outer" scopes. If anyone is contemplating a "Velocity 2.x", I would seriously recommend that macros and other things (like #parse, #evaluate, and similar things) run in their own, local and inherited contexts. This gives much greater freedom to the developer, who doesn't have to worry about "temporary" variables within macros, etc. clobbering variables set in the caller's scope. It would be best if this were simply a language feature, instead of a hack provided through another directive (though it would have to be hacked in this way for Velocity 1.x, since some folks may actually rely on this inconvenient setup. -chris signature.asc Description: OpenPGP digital signature
Re: Call a velocity macro
On Thu, Feb 21, 2008 at 6:36 AM, Christopher Schultz <[EMAIL PROTECTED]> wrote: > Nathan, > > > Nathan Bubna wrote: > > I'm pretty sure #local is still just in Geir's whiteboard section. No > > one has ever gotten it promoted out of there. I've never been opposed > > to it, but i've also never been interested in putting the work needed > > into it (tests, docs, etc). > > I have to admit that when I started really writing macros (other than > super simple ones), I was disappointed to learn that there was no > "stack"... that is, I couldn't implement certain things properly using > the macro facility because recursive calls would overwrite variables > from what I would have considered "outer" scopes. > > If anyone is contemplating a "Velocity 2.x", I would seriously recommend > that macros and other things (like #parse, #evaluate, and similar > things) run in their own, local and inherited contexts. This gives much > greater freedom to the developer, who doesn't have to worry about > "temporary" variables within macros, etc. clobbering variables set in > the caller's scope. > > It would be best if this were simply a language feature, instead of a > hack provided through another directive (though it would have to be > hacked in this way for Velocity 1.x, since some folks may actually rely > on this inconvenient setup. inconvenience is sometimes a matter of perspective, and you might soon find people providing special #setglobal hacks for when they do want to clobber a variable in the caller's scope. personally, i've always been able to see this both ways and never had much trouble adjusting to the lack of scoping. when my macros/layouts/parses ever get complicated enough that i can't track all the variables, i just start namespacing ones i want to keep 'local'. anyway, being able to see both sides and easily adjust either way, you probably won't ever find me motivated to work on this or object to anyone else working to change this in a theoretical 2.x version. namespaces or scoping, i'm good either way. :) > -chris > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Wait - that's not true You certainly can do scoped velocimacros... geir On Feb 21, 2008, at 12:57 PM, Nathan Bubna wrote: On Thu, Feb 21, 2008 at 6:36 AM, Christopher Schultz <[EMAIL PROTECTED]> wrote: Nathan, Nathan Bubna wrote: I'm pretty sure #local is still just in Geir's whiteboard section. No one has ever gotten it promoted out of there. I've never been opposed to it, but i've also never been interested in putting the work needed into it (tests, docs, etc). I have to admit that when I started really writing macros (other than super simple ones), I was disappointed to learn that there was no "stack"... that is, I couldn't implement certain things properly using the macro facility because recursive calls would overwrite variables from what I would have considered "outer" scopes. If anyone is contemplating a "Velocity 2.x", I would seriously recommend that macros and other things (like #parse, #evaluate, and similar things) run in their own, local and inherited contexts. This gives much greater freedom to the developer, who doesn't have to worry about "temporary" variables within macros, etc. clobbering variables set in the caller's scope. It would be best if this were simply a language feature, instead of a hack provided through another directive (though it would have to be hacked in this way for Velocity 1.x, since some folks may actually rely on this inconvenient setup. inconvenience is sometimes a matter of perspective, and you might soon find people providing special #setglobal hacks for when they do want to clobber a variable in the caller's scope. personally, i've always been able to see this both ways and never had much trouble adjusting to the lack of scoping. when my macros/layouts/parses ever get complicated enough that i can't track all the variables, i just start namespacing ones i want to keep 'local'. anyway, being able to see both sides and easily adjust either way, you probably won't ever find me motivated to work on this or object to anyone else working to change this in a theoretical 2.x version. namespaces or scoping, i'm good either way. :) -chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Yeah, sorry. I forget about that, since i've been avoiding macros for some time and never actually bothered with this property: velocimacro.context.localscope = true On Thu, Feb 21, 2008 at 9:59 AM, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote: > Wait - that's not true You certainly can do scoped velocimacros... > > geir > > > > On Feb 21, 2008, at 12:57 PM, Nathan Bubna wrote: > > > On Thu, Feb 21, 2008 at 6:36 AM, Christopher Schultz > > <[EMAIL PROTECTED]> wrote: > >> Nathan, > >> > >> > >> Nathan Bubna wrote: > >>> I'm pretty sure #local is still just in Geir's whiteboard > >>> section. No > >>> one has ever gotten it promoted out of there. I've never been > >>> opposed > >>> to it, but i've also never been interested in putting the work > >>> needed > >>> into it (tests, docs, etc). > >> > >> I have to admit that when I started really writing macros (other than > >> super simple ones), I was disappointed to learn that there was no > >> "stack"... that is, I couldn't implement certain things properly > >> using > >> the macro facility because recursive calls would overwrite variables > >> from what I would have considered "outer" scopes. > >> > >> If anyone is contemplating a "Velocity 2.x", I would seriously > >> recommend > >> that macros and other things (like #parse, #evaluate, and similar > >> things) run in their own, local and inherited contexts. This gives > >> much > >> greater freedom to the developer, who doesn't have to worry about > >> "temporary" variables within macros, etc. clobbering variables set in > >> the caller's scope. > >> > >> It would be best if this were simply a language feature, instead of a > >> hack provided through another directive (though it would have to be > >> hacked in this way for Velocity 1.x, since some folks may actually > >> rely > >> on this inconvenient setup. > > > > inconvenience is sometimes a matter of perspective, and you might soon > > find people providing special #setglobal hacks for when they do want > > to clobber a variable in the caller's scope. personally, i've always > > been able to see this both ways and never had much trouble adjusting > > to the lack of scoping. when my macros/layouts/parses ever get > > complicated enough that i can't track all the variables, i just start > > namespacing ones i want to keep 'local'. > > > > anyway, being able to see both sides and easily adjust either way, you > > probably won't ever find me motivated to work on this or object to > > anyone else working to change this in a theoretical 2.x version. > > namespaces or scoping, i'm good either way. :) > > > >> -chris > >> > >> > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Geir and Nathan, Nathan Bubna wrote: Yeah, sorry. I forget about that, since i've been avoiding macros for some time and never actually bothered with this property: velocimacro.context.localscope = true I think that has further implications that what I was suggesting, which is a scope that inherits from the global (or outer) scope, rather than a completely separate, private scope. IIRC, localscope=true means that anything you want to get from the outer scope must be passed-in as a parameter to the macro (which wouldn't be all that bad, honestly). -chris signature.asc Description: OpenPGP digital signature
Re: Call a velocity macro
Hello Jonathan, /"Well, in general, once you want to do anything moderately complex with velocimacros, the thing breaks because it's *junk.* :-)"/ It's not nice to say about a different library(a "competitor") "it's junk", even if the library is not as good as yours(I'm not sure if you a commiter or just a user of FreeMarker). I agree, velocity has some weak parts, but this doesn't mean is "junk". I'm not pro Velocity and against FreeMarker of vice versa, and I am glad for the existence of projects like Velocity or FreeMarker(all the Apache projects, etc). So let's play nice...You can post articles about "FreeMarker is better that Velocity" but do it with professionalism. PS . My framework(yet another java framework??? :) ) allows me to choose between any template engine without modify any Java code so it is transparent for me in general. This situation with calling dynamically a macro is the first exception in years, usually I have anything I need in Velocity, I don't need to think about another library(not that the Velocity is the only good template engine, but I got used with it). Jonathan Revusky wrote: Adrian Tarau wrote: I've always used #if to implement the 'switch' but I think, even for 3-4 conditions, the template will look cleaner. Instead of #if('renderLabel' == $macroToCall) #renderLabel($component) #elseif('renderInput' == $macroToCall) #renderInput($component) #elseif(...) ... #end we will have #call($macroToCall $component). This kind of thing is trivial in FreeMarker. For example, suppose you had: <#assign macroHash = {'renderLabel' : labelMacro, 'renderInput' : renderMacro, > and then, supposing you have an action string, like suppose: [#assign action = 'renderLabel'] then you could invoke the macro via: <@macroHash[action] component /> The thing is that macros in FreeMarker are variables, and can be in hashes or assigned to variables or whatever, and also the foo in <@foo/> to invoke the macro can be any arbitrary expression. So, for example, suppose the macro you want to invoke is in the string macroName, you could invoke it via: <@.vars[macroName] component/> (.vars is a special built-in hash that contains the variables available in the template and since macros are variables as well, .vars[macroName] is the macro with the name macroName and it can be invoked this way, or you could create a variable. <#assign myMacro = .vars[macroName]> and invoke it via: <@myMacro component/> Right below this, Mr. Van Bergen mentions Anakia, which is an add-on to Velocity for processing XML. He neglects to mention that FreeMarker provides similar XML processing functionality (though the implementation is much more complete, since it supports XML namespaces, for example) as part of its core feature set. Declarative XML processing is supported in FreeMarker via the #visit and #recurse directives, which are core directives in the FreeMarker language. One would infer from what the article says that XML processing is a point in favor of Velocity, when, really, quite the opposite is the case. The XML processing functionality available for Velocity is add-ons like Anakia and DVSL that are basically abandonware, where the XML processing support in FreeMarker is a core part of the product, and is clearly supported. Well, in general, once you want to do anything moderately complex with velocimacros, the thing breaks because it's junk. :-) Here is a blog entry I wrote regarding some of this sort of thing: http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html Jonathan Revusky -- lead developer, FreeMarker project, http://freemarker.org/ In case of a value outside the 'domain' you will get an exception "Macro not found ". We could have even a directive which will simulate the switch default branch. #callWithDefault($macroToCall $defaultMacro ) - of course the name should be shorter. Christopher Schultz wrote: Adrian, Adrian Tarau wrote: I have the following problem : I would like to call a macro but the macro name must be a variable. This is more of a question for the user's list, not the dev list. In the future, please post there. Ex: instead of #renderLabel($component) to have #call("renderLabel" $component) - of course "renderLabel" can be any (existing) macro name. How many possibilities can you have for $component? Are they unlimited, or constrained to maybe 5 possibilities? I'm wondering because you could easily do it like a switch: #if('renderLabel' == $macroToCall) #renderLabel($component) #elseif('renderInput' == $macroToCall) #renderInput($component) #elseif(...) ... #end -chris
Re: Call a velocity macro
Adrian Tarau wrote: Hello Jonathan, /"Well, in general, once you want to do anything moderately complex with velocimacros, the thing breaks because it's *junk.* :-)"/ It's not nice to say about a different library(a "competitor") "it's junk", even if the library is not as good as yours(I'm not sure if you a commiter or just a user of FreeMarker). What's not nice and a clear violation of nettiquette, as well as basic common sense, is to respond to a private message (one that was clearly meant to be private) in a public forum. Well... okay, I guess you just don't know that. If you don't know, you don't know. However, it stands to reason that if you don't know that, there are may be plenty of other basic things you don't know. So, first of all, there is no onus on me, particularly in a private note, to pretend that I think that Velocity is anything other than obsolete junk. I agree, velocity has some weak parts, but this doesn't mean is "junk". Well, that's debatable. There's no clear definition of what "junk" means. A key characteristic of junk, at least most junk, is that, at one point in the past, it was something of value. Some 386 or 486-based PC lying around in someone's basement is junk, but at some point in the past, it was a highly valued state of the art piece of equipment. Getting back to niceness, since you accuse me of not being nice, one thing that wouldn't be nice would be to sell that old 386 or 486 to someone who had no knowledge of computers and represent that it was something that was state of the art and so on. I'm not pro Velocity and against FreeMarker of vice versa, and I am glad for the existence of projects like Velocity or FreeMarker(all the Apache projects, etc). Besides nettiquette, a whole aspect of this you don't seem to understand is that projects are really only useful if they are approximately competitive with the state of the art in their space. I could write a simple text editor or database this weekend and start announcing it on all the appropriate forums. However, it would be a complete and utter waste of time. Not only would I be wasting my own time (no big deal) but I would trying to get people to waste their time as well. When things like emacs and jedit exist, nothing I could write in short order would be remotely of any interest to anybody. Look, it takes a certain ego and nerve to announce your work to fellow professionals on places like freshmeat.net and theserverside.com etcetera. To do this takes a certain ego. You have to believe that, what with all the things out there that, people really should take the time to look at what you've done. It has to be broadly competitive with the state of the art. So let's play nice...You can post articles about "FreeMarker is better that Velocity" but do it with professionalism. The whole idea that I, in the name of "professionalism" have to pretend that the emperor is wearing any clothes, particularly in a private note, is just absurd. Even in public there is no particular need for me to do so. You may have noticed that people who review movies online and elsewhere do not feel obliged to tell you that every movie that comes out is actually good. And likewise, I am under no obligation to say that every software tool out there is good. I don't consider Apache Velocity to be something of high quality, to say the least. Not only is it lacking in features that really should be considered by now to be basic to templating in the web space, it embodies numerous first order mistakes in design and implementation that, in over 7 years of existence, nobody has put in the effort to remedy. In my considered opinion, it is naive and misguided to feel gratitude to ASF for something like Velocity. I believe that if Apache were run in a way that really reflects its charter, to be of benefit to the overall developer community, something in the state of Velocity would be labeled as abandonware. Basically, the maintainers would have been put on notice that they had to either get the thing in a state that it is approximately competitive in its space, or the front page of the project would say something like "Hi, I'm an abandoned piece of software. If you want to adopt me, here is the procedure to do so." If Velocity and the other many projects in the same state were labelled that way, it would be of much greater benefit to the larger community. First of all, people would be dissuaded from investing energy into something that is obsolete and unmaintained. Also, people who actually do want to do the work of maintaining the project would have a chance to do so. But alas, obviously this is not the case. And specifically, that is why so many software projects out there have initially used Velocity (based on the belief that it was approximately competitive and being maintained) and later had to switch to another tool, typically FreeMarker. Some of the best know
RE: Call a velocity macro
Jonathan, Basic common sense? Based on your long posts on Velocity forum, I think I can ask you if you have some common sense. If you really think Velocity is a dinosaur, you could let him die(with some respect if you say it meant something 7 years ago).If you think FreeMarker is the brightest start above the horizon, you should let the users to discover FreeMarker by themselves. If there is somebody out there looking for a template engine and he's going to stop to Velocity without evaluation other projects, it's his fault if fails(if he finally realized Velocity doesn't have all the features he needs). It's his bad, not because Velocity is a *junk*, is just because he didn't took some time to evaluate at least 2 projects. Even if you fail to choose the right project(the reason doesn't matter), it is still useful for you, everybody learns from mistakes. Even with Velocity, most of the problems will be on your project side. Those missing feature will not block you form releasing your project, I can tell you that. If you search after "java template engine" in Google, you'll find Velocity and FreeMarker, so it would be really hard to miss FreeMarker and choose Velocity(if you're afraid of that). Some people could use Velocity even if it lacks some features just because of the syntax, or just some other "stupid" reasons. This is not about coding style, features and not even performance(even if it is an important aspect). Even if you do a code review, some similar rules applies : review the code and not the person(project), ask for the reason why the code is as it is, ask before accuse, etc, etc. I'm not going to continue arguing with you why you shouldn't behave like this, I think if you didn't got it until now it is too late to try now. I will not be one who will "turn you to the light" :), that's my personal feeling. My personal advice is let the community to grow around you and let others live with their projects. In the end, everybody will win. Best wishes, Adrian Tarau. PS. It was not my intention to reveal your private message, it was more an "automatic" reaction to the words "project", "junk", "mine is better" based on my personal experience. My apologies to you. If you really want to help somebody(who reached the end of the road with Velocity) just reply with a link to FreeMarker and let the user decide, before you will write long(or short) paragraphs about ... you know ... junk. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Revusky Sent: Saturday, March 08, 2008 4:55 PM To: dev@velocity.apache.org Subject: Re: Call a velocity macro Adrian Tarau wrote: > Hello Jonathan, > > /"Well, in general, once you want to do anything moderately complex with > velocimacros, the thing breaks because it's *junk.* :-)"/ > > It's not nice to say about a different library(a "competitor") "it's > junk", even if the library is not as good as yours(I'm not sure if you a > commiter or just a user of FreeMarker). What's not nice and a clear violation of nettiquette, as well as basic common sense, is to respond to a private message (one that was clearly meant to be private) in a public forum. Well... okay, I guess you just don't know that. If you don't know, you don't know. However, it stands to reason that if you don't know that, there are may be plenty of other basic things you don't know. So, first of all, there is no onus on me, particularly in a private note, to pretend that I think that Velocity is anything other than obsolete junk. > I agree, velocity has some weak parts, but this doesn't mean is "junk". Well, that's debatable. There's no clear definition of what "junk" means. A key characteristic of junk, at least most junk, is that, at one point in the past, it was something of value. Some 386 or 486-based PC lying around in someone's basement is junk, but at some point in the past, it was a highly valued state of the art piece of equipment. Getting back to niceness, since you accuse me of not being nice, one thing that wouldn't be nice would be to sell that old 386 or 486 to someone who had no knowledge of computers and represent that it was something that was state of the art and so on. > I'm not pro Velocity and against FreeMarker of vice versa, and I am glad > for the existence of projects like Velocity or FreeMarker(all the Apache > projects, etc). Besides nettiquette, a whole aspect of this you don't seem to understand is that projects are really only useful if they are approximately competitive with the state of the art in their space. I could write a simple text editor or database this wee
Re: Call a velocity macro
other "stupid" reasons. This is not about coding style, features and not even performance(even if it is an important aspect). Even if you do a code review, some similar rules applies : review the code and not the person(project), ask for the reason why the code is as it is, ask before accuse, etc, etc. What are you talking about? I'm not going to continue arguing with you why you shouldn't behave like this, I think if you didn't got it until now it is too late to try now. I will not be one who will "turn you to the light" :), that's my personal feeling. My personal advice is let the community to grow around you and let others live with their projects. In the end, everybody will win. No, Adrian, everybody wins when the things being offered are all approximately state of the art. When you have people pushing something obsolete, at least some people lose. They waste valuable developer time with things that they shouldn't have wasted time with. That was pretty clearly what happened in Max Andersen's "Story about FreeMarker and Velocity" (http://in.relation.to/Bloggers/AStoryAboutFreeMarkerAndVelocity ) Not only did Max lose a lot of time with Velocity, the users of his HIbernate Tools project clearly did. The basic logical fallacy you're engaging in is the idea that all choices are valid. I walk into the local bakery and they've got all kinds of bread, right? They've got french bread, german style dark bread, sourdough, rye I have choice and they're all valid choices. Yeah, that's a lot better for the consumer than only having one kind of bread. BUT THAT'S ONLY IF THE BREAD IS ALL FRESH!!! If the only freshly baked bread there is the rye bread, say, and the other choices are all several days old and stale and hard, then my ability to choose among different kinds of bread offers no extra value. Obviously, because there is only one kind of bread that is fresh. In fact, in this scenario of choices, the consumer would clearly be better off if the bakery only offered that one kind of bread, because then the he could not ever purchase the stale bread by accident. And of course, that becomes increasingly likely when the stale bread is displayed prominently as if it was fresh. And what's the difference between that and Nathan Bubna gushing about exciting new ideas that have existed in competing products for 5 years or more? I mean, encouraging people to be so misguided about what the state of the art in the space is, it just leads people to waste their time. The guy who started the original discussion (this time round, it's come up at least a few times before, but nothing was ever done) I wrote that guy a note in private (to which he did NOT respond in public, of course) and a while later, I have some further correspondence with him and he is now using FreeMarker. Just an example. Rational, pragmatic people have no particular interest in wasting their time. He sees that another project already has the features in mature form that he was starting to implement in Velocity, and bango, he just switches to that. Best wishes, Adrian Tarau. PS. It was not my intention to reveal your private message, it was more an "automatic" reaction to the words "project", "junk", You're lying, Adrian. It's was not an "automatic" reaction. An automatic reaction would involve hitting reply-to and it would go back to me. You quite consciously changed to the destination address so that it would go to the public forum. "mine is better" based on my personal experience. My apologies to you. I don't think I can accept the apology. I don't think I can accept an apology that (a) contains an obvious lie and (b) is in a message that is such a self-righteous lecturing tone. Feel free to write a proper apology when you've cooled off. Jonathan Revusky -- lead developer, FreeMarker project, http://freemarker.org/ Velocity or FreeMarker: Looking at 5 Years of Practical Experience http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html > If you really want to help somebody(who reached the end of the road with Velocity) just reply with a link to FreeMarker and let the user decide, before you will write long(or short) paragraphs about ... you know ... junk. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Revusky Sent: Saturday, March 08, 2008 4:55 PM To: dev@velocity.apache.org Subject: Re: Call a velocity macro Adrian Tarau wrote: Hello Jonathan, /"Well, in general, once you want to do anything moderately complex with velocimacros, the thing breaks because it's *junk.* :-)"/ It's not nice to say about a different library(a "competitor") "it's junk", even if the library is not
Re: Call a velocity macro
Sunday, March 9, 2008, 6:21:20 PM, Jonathan Revusky wrote: [snip] > 7 years ago (maybe closer to 8 years ago) Velocity was written by Jon > "Monkey see, Monkey do" Stevens as a copycat clone of an existing open > source project called WebMacro. [snip] But Jonathan... you Don't Get It: It's the Apache Way! :-> [snip] > pretty obvious that Velocity, like Struts 1.x and other obsolete things, [snip] Velocity is not obsolete. It's just a poor quality stuff starting from its very beginning, as it's made by incompetent/talentless people OR by people who were not interested in the topic. (It's not to say that FreeMarker is good, because it's *bad*... but obviously less so than Velocity is.) -- Best regards, Daniel Dekany - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
ng just gets to be too much. I think JSP 2.x has had that for years too. If you search after "java template engine" in Google, you'll find Velocity and FreeMarker, so it would be really hard to miss FreeMarker and choose Velocity(if you're afraid of that). Some people could use Velocity even if it lacks some features just because of the syntax, or just some other "stupid" reasons. This is not about coding style, features and not even performance(even if it is an important aspect). Even if you do a code review, some similar rules applies : review the code and not the person(project), ask for the reason why the code is as it is, ask before accuse, etc, etc. What are you talking about? I'm not going to continue arguing with you why you shouldn't behave like this, I think if you didn't got it until now it is too late to try now. I will not be one who will "turn you to the light" :), that's my personal feeling. My personal advice is let the community to grow around you and let others live with their projects. In the end, everybody will win. No, Adrian, everybody wins when the things being offered are all approximately state of the art. When you have people pushing something obsolete, at least some people lose. They waste valuable developer time with things that they shouldn't have wasted time with. That was pretty clearly what happened in Max Andersen's "Story about FreeMarker and Velocity" (http://in.relation.to/Bloggers/AStoryAboutFreeMarkerAndVelocity ) Not only did Max lose a lot of time with Velocity, the users of his HIbernate Tools project clearly did. The basic logical fallacy you're engaging in is the idea that all choices are valid. I walk into the local bakery and they've got all kinds of bread, right? They've got french bread, german style dark bread, sourdough, rye I have choice and they're all valid choices. Yeah, that's a lot better for the consumer than only having one kind of bread. BUT THAT'S ONLY IF THE BREAD IS ALL FRESH!!! If the only freshly baked bread there is the rye bread, say, and the other choices are all several days old and stale and hard, then my ability to choose among different kinds of bread offers no extra value. Obviously, because there is only one kind of bread that is fresh. In fact, in this scenario of choices, the consumer would clearly be better off if the bakery only offered that one kind of bread, because then the he could not ever purchase the stale bread by accident. And of course, that becomes increasingly likely when the stale bread is displayed prominently as if it was fresh. And what's the difference between that and Nathan Bubna gushing about exciting new ideas that have existed in competing products for 5 years or more? I mean, encouraging people to be so misguided about what the state of the art in the space is, it just leads people to waste their time. The guy who started the original discussion (this time round, it's come up at least a few times before, but nothing was ever done) I wrote that guy a note in private (to which he did NOT respond in public, of course) and a while later, I have some further correspondence with him and he is now using FreeMarker. Just an example. Rational, pragmatic people have no particular interest in wasting their time. He sees that another project already has the features in mature form that he was starting to implement in Velocity, and bango, he just switches to that. Best wishes, Adrian Tarau. PS. It was not my intention to reveal your private message, it was more an "automatic" reaction to the words "project", "junk", You're lying, Adrian. It's was not an "automatic" reaction. An automatic reaction would involve hitting reply-to and it would go back to me. You quite consciously changed to the destination address so that it would go to the public forum. "mine is better" based on my personal experience. My apologies to you. I don't think I can accept the apology. I don't think I can accept an apology that (a) contains an obvious lie and (b) is in a message that is such a self-righteous lecturing tone. Feel free to write a proper apology when you've cooled off. Jonathan Revusky -- lead developer, FreeMarker project, http://freemarker.org/ Velocity or FreeMarker: Looking at 5 Years of Practical Experience http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html > If you really want to help somebody(who reached the end of the road with Velocity) just reply with a link to FreeMarker and let the user decide, before you will write long(or short) paragraphs about ... you know ... junk. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Revusk
RE: Call a velocity macro
Jonathan, I must confess you are above my expectations/past experiences. When I post your "nice words" on the mailing list(development list by the way) I didn't knew who you are. I thought you are just a regular user(or even a FreeMarker commiter) who is way to passionate about FreeMarker and tries to trash the Velocity name just because he had a bad experience with Velocity. When Nathan Bubna wrote me and told me who you are, I realized I just started some old war between Velocity and FreeMarker(after I read some of your old posts).So there was not my intention to trash the FreeMarker lead developer name because *I didn't knew who you are*. World like "dipshit", "despicable", don't sit very well near "lead developer" or even "software engineer". I would expect something like this in a bar, but not on a mailing list. Reading your last post, I realized you don't get it and probably you don't understand the concept. !!!IT'S ALL ABOUT RESPECT!!!. I don't care how many bad designs or weak points has Velocity, you should treat the Velocity community, the current developers, past and current owners with RESPECT. Jonathan , there are other ways to bring new users to FreeMarker...your way is completely wrong. You, as a (past) Velocity user are entitled to wrote about your bad experiences with Velocity and thanks to the current search engines your words will be "visible" in the first 100 results in any search engine. If the Velocity developers won't take action to improve the engine and all those bad experiences will pile up, Velocity will die by itself, you don't need to help it. Or you could help, but do it in a different way. Try to get this and you will sleep better. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Revusky Sent: Sunday, March 09, 2008 1:21 PM To: dev@velocity.apache.org Subject: Re: Call a velocity macro Adrian Tarau wrote: > Jonathan, > > Basic common sense? Based on your long posts on Velocity forum, I think I can > ask you if you have some common sense. Adrian, you little dipshit, whatever long posts I wrote on this forum were responses to other public posts on the forum. I wrote you a note in private and you responded on the public forum. That is the violation of nettiquette I am referring to. If you don't understand that you are not supposed to do that, as I said before, you don't understand much. Well, it's not just that, Adrian. You're such a despicable hypocrite. I mean, why did you respond in public to a private note? Obviously to try to goad me into starting some kind of flame war or whatever. You try to goad somebody into responding and then you say "tsk tsk, look what a bad guy you are". Typical stuff, but it's pathetic. I mean, you're pathetic, Adrian. > > If you really think Velocity is a dinosaur, you could let him die(with some > respect if you say it meant something 7 years ago). 7 years ago (maybe closer to 8 years ago) Velocity was written by Jon "Monkey see, Monkey do" Stevens as a copycat clone of an existing open source project called WebMacro. It was such a mindless copycat job that he even copied some rather strange limitations of WebMacro. One such thing was that WebMacro had no support for decimal numbers, only integers, probably because the original author had not got round to implementing it. You know, really, it's just like a dim student who copies another student's exam answers word for word, including the spelling mistakes. The really humorous thing about this is that, at a later stage, when people showed up who obviously needed decimal numbers, Velocity maintainers (rather than just implementing decimal number support) spent all kinds of energy arguing that the lack of decimal numbers in Velocity was the result of some kind of profound philosophical thinking on their part,.. yeah, like they'd really thought about it and decided that integers were good, but decimal numbers bad. Of course, everybody who knew the history of the project knew that Velocity lacked decimal number support because it was a mindless copy of Webmacro, which in turn lacked decimal number support. In any case, do you think that's really a very nice thing to do? You write a mindless copy of somebody else's work and then you use the apache.org projection to eclipse the original pioneering work? It's the kind of thing Microsoft historically does, but at least that's to make money, so it makes sense. The origins of the Velocity project really are in behavior that is somewhat pathological. I mean, how would you feel about this if you were the original author of WebMacro? It's really not very nice. These really aren't very nice people. Now, to be fair, all the original authors
RE: Call a velocity macro
I would like to apologize, It was NOT my intention to start something like this. I do NOT publish private messages on public mailing lists with the intention to make a person look bad, I'm just sensitive to disrespectful people. I just felt I had to post something on the devel list. Actually this is my first bad experience in 7-8 years on a forum/mailing list. On public or private messages I always had a civilized dialog with different software developers, even if sometime the subject was a little bit "hot". My apologies if when I published his rant, it looked like a dishonest action on my side. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Revusky Sent: Sunday, March 09, 2008 1:21 PM To: dev@velocity.apache.org Subject: Re: Call a velocity macro Adrian Tarau wrote: > Jonathan, > > Basic common sense? Based on your long posts on Velocity forum, I think I can > ask you if you have some common sense. Adrian, you little dipshit, whatever long posts I wrote on this forum were responses to other public posts on the forum. I wrote you a note in private and you responded on the public forum. That is the violation of nettiquette I am referring to. If you don't understand that you are not supposed to do that, as I said before, you don't understand much. Well, it's not just that, Adrian. You're such a despicable hypocrite. I mean, why did you respond in public to a private note? Obviously to try to goad me into starting some kind of flame war or whatever. You try to goad somebody into responding and then you say "tsk tsk, look what a bad guy you are". Typical stuff, but it's pathetic. I mean, you're pathetic, Adrian. > > If you really think Velocity is a dinosaur, you could let him die(with some > respect if you say it meant something 7 years ago). 7 years ago (maybe closer to 8 years ago) Velocity was written by Jon "Monkey see, Monkey do" Stevens as a copycat clone of an existing open source project called WebMacro. It was such a mindless copycat job that he even copied some rather strange limitations of WebMacro. One such thing was that WebMacro had no support for decimal numbers, only integers, probably because the original author had not got round to implementing it. You know, really, it's just like a dim student who copies another student's exam answers word for word, including the spelling mistakes. The really humorous thing about this is that, at a later stage, when people showed up who obviously needed decimal numbers, Velocity maintainers (rather than just implementing decimal number support) spent all kinds of energy arguing that the lack of decimal numbers in Velocity was the result of some kind of profound philosophical thinking on their part,.. yeah, like they'd really thought about it and decided that integers were good, but decimal numbers bad. Of course, everybody who knew the history of the project knew that Velocity lacked decimal number support because it was a mindless copy of Webmacro, which in turn lacked decimal number support. In any case, do you think that's really a very nice thing to do? You write a mindless copy of somebody else's work and then you use the apache.org projection to eclipse the original pioneering work? It's the kind of thing Microsoft historically does, but at least that's to make money, so it makes sense. The origins of the Velocity project really are in behavior that is somewhat pathological. I mean, how would you feel about this if you were the original author of WebMacro? It's really not very nice. These really aren't very nice people. Now, to be fair, all the original authors of Velocity, anybody who designed or implemented any significant part of the codebase, are long gone. What you have now is a set of poeple who have taken on the role of being "owners" of the project, because it's some kind of feather in their cap or something. But really, if you really look at it, what they're doing is totally masturbatory, putting out infinitesimal incremental releases of a product that is 6 years behind the state of the art in its space. And again, aside from being rather pathetic, is that really a very nice thing to be doing? I mean, the problem is that a lot of people in this field are pressed for time and cannot evaluate everything properly, so many people see something is on apache.org, and they reason, okay, I'm using the Apache Web Server, or I'm using tomcat, so it makes sense to use the templating engine that comes from apache. So this, and basically anything on apache.org, gets a level of attention and usage totally out of proportion to its technical merit. So, you can see why people would end up thinking that Velocity is a reasonable option and use it. The problem is, of cou
Re: Call a velocity macro
:D Hilarious! I mean, everybody knows Jonathan is an ass hole for his doing this aggressive "advertising" here, and I told him back then for several occasions to stop it (I'm a FreeMarker contributor... coming from the side of the SATAN , you know), but what he brings out of you guys worths all the face loss of the FM project. :) I understand that ass licking and being Politically Correct and things like that are very important for being "professional", means, for a good career. I can handle that, life is that disgusting and cruel, etc... I shut my trap at may employees as well, and of course I LOVE THEM ;), who ever they are. If they think that brings them the income, so be it. But, sometimes I have the feeling that some of you are not just pretending these things for practical considerations, but you indeed think it seriously! And that's creepy. Since when should people respect things that are bad, and since when it's not professional to call the sh*t to what it is? Especially in private??? Come on! I have to puke from all of this liberal bullshit when someone honestly believes these. How can someone be such a... eh. And then you felt you have to report it on the list, or what was that??? And then... this "When Nathan Bubna wrote me"... I know it's not the same case, but I can't help but remember when on another ASF list I was critical about a certain technical aspect of a project, in a *professional* but surely firm way, and another user started to discuss the stuff with me as opposed to trying to gently ridicule the issue. And later he wrote me in private, that he wont continue, because his employer, whose company was connected with some key personal at the ASF project, was told him that, well, it was a wrong thing that he has talked to me. He was almost angry with me because I got him into trouble. God... You see, poor guy was all time there on the list, but he didn't realize I was internally declared to be persona non garta (it seems...), and he talked to me! What a mistake! :) Monday, March 10, 2008, 3:46:39 AM, Adrian Tarau wrote: > Jonathan, > > I must confess you are above my expectations/past experiences. When > I post your "nice words" on the mailing list(development list by the > way) I didn't knew who you are. I thought you are just a regular > user(or even a FreeMarker commiter) who is way to passionate about > FreeMarker and tries to trash the Velocity name just because he had a bad > experience with Velocity. > When Nathan Bubna wrote me and told me who you are, I realized I > just started some old war between Velocity and FreeMarker(after I > read some of your old posts).So there was not my intention to trash > the FreeMarker lead developer name because *I didn't knew who you are*. > > World like "dipshit", "despicable", don't sit very well near "lead > developer" or even "software engineer". I would expect something > like this in a bar, but not on a mailing list. > > Reading your last post, I realized you don't get it and probably > you don't understand the concept. !!!IT'S ALL ABOUT RESPECT!!!. > I don't care how many bad designs or weak points has Velocity, you > should treat the Velocity community, the current developers, past > and current owners with RESPECT. Jonathan , there are other ways to > bring new users to FreeMarker...your way is completely wrong. > > You, as a (past) Velocity user are entitled to wrote about your bad > experiences with Velocity and thanks to the current search engines > your words will be "visible" in the first 100 results in any search > engine. If the Velocity developers won't take action to improve the > engine and all those bad experiences will pile up, Velocity will die > by itself, you don't need to help it. Or you could help, but do it in a > different way. > > Try to get this and you will sleep better. > > -Original Message- > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Revusky > Sent: Sunday, March 09, 2008 1:21 PM > To: dev@velocity.apache.org > Subject: Re: Call a velocity macro > > Adrian Tarau wrote: >> Jonathan, >> >> Basic common sense? Based on your long posts on Velocity forum, I think I >> can ask you if you have some common sense. > > Adrian, you little dipshit, whatever long posts I wrote on this forum > were responses to other public posts on the forum. I wrote you a note in > private and you responded on the public forum. That is the violation of > nettiquette I am referring to. If you don't understand that you are not > supposed to do that, as I said before, you don't understand much. > > Well, it's not just that, Adrian. You're such a despicable hypo
Re: Call a velocity macro
ces are all several days old and stale and hard, then my ability to choose among different kinds of bread offers no extra value. Obviously, because there is only one kind of bread that is fresh. In fact, in this scenario of choices, the consumer would clearly be better off if the bakery only offered that one kind of bread, because then the he could not ever purchase the stale bread by accident. And of course, that becomes increasingly likely when the stale bread is displayed prominently as if it was fresh. And what's the difference between that and Nathan Bubna gushing about exciting new ideas that have existed in competing products for 5 years or more? I mean, encouraging people to be so misguided about what the state of the art in the space is, it just leads people to waste their time. The guy who started the original discussion (this time round, it's come up at least a few times before, but nothing was ever done) I wrote that guy a note in private (to which he did NOT respond in public, of course) and a while later, I have some further correspondence with him and he is now using FreeMarker. Just an example. Rational, pragmatic people have no particular interest in wasting their time. He sees that another project already has the features in mature form that he was starting to implement in Velocity, and bango, he just switches to that. Best wishes, Adrian Tarau. PS. It was not my intention to reveal your private message, it was more an "automatic" reaction to the words "project", "junk", You're lying, Adrian. It's was not an "automatic" reaction. An automatic reaction would involve hitting reply-to and it would go back to me. You quite consciously changed to the destination address so that it would go to the public forum. "mine is better" based on my personal experience. My apologies to you. I don't think I can accept the apology. I don't think I can accept an apology that (a) contains an obvious lie and (b) is in a message that is such a self-righteous lecturing tone. Feel free to write a proper apology when you've cooled off. Jonathan Revusky -- lead developer, FreeMarker project, http://freemarker.org/ Velocity or FreeMarker: Looking at 5 Years of Practical Experience http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html > If you really want to help somebody(who reached the end of the road with Velocity) just reply with a link to FreeMarker and let the user decide, before you will write long(or short) paragraphs about ... you know ... junk. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Revusky Sent: Saturday, March 08, 2008 4:55 PM To: dev@velocity.apache.org Subject: Re: Call a velocity macro Adrian Tarau wrote: Hello Jonathan, /"Well, in general, once you want to do anything moderately complex with velocimacros, the thing breaks because it's *junk.* :-)"/ It's not nice to say about a different library(a "competitor") "it's junk", even if the library is not as good as yours(I'm not sure if you a commiter or just a user of FreeMarker). What's not nice and a clear violation of nettiquette, as well as basic common sense, is to respond to a private message (one that was clearly meant to be private) in a public forum. Well... okay, I guess you just don't know that. If you don't know, you don't know. However, it stands to reason that if you don't know that, there are may be plenty of other basic things you don't know. So, first of all, there is no onus on me, particularly in a private note, to pretend that I think that Velocity is anything other than obsolete junk. I agree, velocity has some weak parts, but this doesn't mean is "junk". Well, that's debatable. There's no clear definition of what "junk" means. A key characteristic of junk, at least most junk, is that, at one point in the past, it was something of value. Some 386 or 486-based PC lying around in someone's basement is junk, but at some point in the past, it was a highly valued state of the art piece of equipment. Getting back to niceness, since you accuse me of not being nice, one thing that wouldn't be nice would be to sell that old 386 or 486 to someone who had no knowledge of computers and represent that it was something that was state of the art and so on. I'm not pro Velocity and against FreeMarker of vice versa, and I am glad for the existence of projects like Velocity or FreeMarker(all the Apache projects, etc). Besides nettiquette, a whole aspect of this you don't seem to understand is that projects are really only useful if they are approximately competitive with the state of the art in their space. I could write a simple text editor or database this weekend and start ann
Re: Call a velocity macro
Try to get this and you will sleep better. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Revusky Sent: Sunday, March 09, 2008 1:21 PM To: dev@velocity.apache.org Subject: Re: Call a velocity macro Adrian Tarau wrote: Jonathan, Basic common sense? Based on your long posts on Velocity forum, I think I can ask you if you have some common sense. Adrian, you little dipshit, whatever long posts I wrote on this forum were responses to other public posts on the forum. I wrote you a note in private and you responded on the public forum. That is the violation of nettiquette I am referring to. If you don't understand that you are not supposed to do that, as I said before, you don't understand much. Well, it's not just that, Adrian. You're such a despicable hypocrite. I mean, why did you respond in public to a private note? Obviously to try to goad me into starting some kind of flame war or whatever. You try to goad somebody into responding and then you say "tsk tsk, look what a bad guy you are". Typical stuff, but it's pathetic. I mean, you're pathetic, Adrian. If you really think Velocity is a dinosaur, you could let him die(with some respect if you say it meant something 7 years ago). 7 years ago (maybe closer to 8 years ago) Velocity was written by Jon "Monkey see, Monkey do" Stevens as a copycat clone of an existing open source project called WebMacro. It was such a mindless copycat job that he even copied some rather strange limitations of WebMacro. One such thing was that WebMacro had no support for decimal numbers, only integers, probably because the original author had not got round to implementing it. You know, really, it's just like a dim student who copies another student's exam answers word for word, including the spelling mistakes. The really humorous thing about this is that, at a later stage, when people showed up who obviously needed decimal numbers, Velocity maintainers (rather than just implementing decimal number support) spent all kinds of energy arguing that the lack of decimal numbers in Velocity was the result of some kind of profound philosophical thinking on their part,.. yeah, like they'd really thought about it and decided that integers were good, but decimal numbers bad. Of course, everybody who knew the history of the project knew that Velocity lacked decimal number support because it was a mindless copy of Webmacro, which in turn lacked decimal number support. In any case, do you think that's really a very nice thing to do? You write a mindless copy of somebody else's work and then you use the apache.org projection to eclipse the original pioneering work? It's the kind of thing Microsoft historically does, but at least that's to make money, so it makes sense. The origins of the Velocity project really are in behavior that is somewhat pathological. I mean, how would you feel about this if you were the original author of WebMacro? It's really not very nice. These really aren't very nice people. Now, to be fair, all the original authors of Velocity, anybody who designed or implemented any significant part of the codebase, are long gone. What you have now is a set of poeple who have taken on the role of being "owners" of the project, because it's some kind of feather in their cap or something. But really, if you really look at it, what they're doing is totally masturbatory, putting out infinitesimal incremental releases of a product that is 6 years behind the state of the art in its space. And again, aside from being rather pathetic, is that really a very nice thing to be doing? I mean, the problem is that a lot of people in this field are pressed for time and cannot evaluate everything properly, so many people see something is on apache.org, and they reason, okay, I'm using the Apache Web Server, or I'm using tomcat, so it makes sense to use the templating engine that comes from apache. So this, and basically anything on apache.org, gets a level of attention and usage totally out of proportion to its technical merit. So, you can see why people would end up thinking that Velocity is a reasonable option and use it. The problem is, of course, that, eventually many people end up realizing waht's up with this. Consider what Max Andersen is saying in this blog entry: http://in.relation.to/Bloggers/AStoryAboutFreeMarkerAndVelocity Here is a quote: "The choice originally fell on Velocity since it was the biggest player around, and I added it naively thinking that the error and log handling could not be that bad if so many people were using it and if there were an issue it would be fixed soon. As time went by I learned that it was definitely not the case." He's openly saying that he didn't research the alternatives, because it was highly v
RE: Call a velocity macro
--- Yates Family <[EMAIL PROTECTED]> wrote: > I joined this mailing list in the hope I would gain > access to a bank of > experienced developers by which of course I could > draw on and develop my own > skills and techniques. After reading these posts, I > am not convinced these > mailing lists are an appropriate tool which > facilitates active and > constructive participation. I will not be > recommending this to my > professional colleagues within the industry. just add filter to squelch white noise prouced by dacota jack, jonathan revusky and other freemarker trolls - and you will be fine. regards [ Konstantin Pribluda http://www.pribluda.de ] JTec quality components: http://www.pribluda.de/projects/ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Steven, Don't judge this community by this thread - we have a long history of constructive and positive collaborative development. Give it another chance. geir On Mar 10, 2008, at 8:05 AM, Yates Family wrote: I take my hat off to all current, previous and prospective OS developers. Clearly without the collective input and ideas this developer community contributes to projects such as Velocity, software development as a respected profession will struggle to earn a reputation as an innovative vehicle which drives results. I joined this mailing list in the hope I would gain access to a bank of experienced developers by which of course I could draw on and develop my own skills and techniques. After reading these posts, I am not convinced these mailing lists are an appropriate tool which facilitates active and constructive participation. I will not be recommending this to my professional colleagues within the industry. Many Thanks Steven Yates -Original Message- From: Daniel Dekany [mailto:[EMAIL PROTECTED] Sent: Monday, 10 March 2008 3:51 PM To: Velocity Developers List Subject: Re: Call a velocity macro :D Hilarious! I mean, everybody knows Jonathan is an ass hole for his doing this aggressive "advertising" here, and I told him back then for several occasions to stop it (I'm a FreeMarker contributor... coming from the side of the SATAN , you know), but what he brings out of you guys worths all the face loss of the FM project. :) I understand that ass licking and being Politically Correct and things like that are very important for being "professional", means, for a good career. I can handle that, life is that disgusting and cruel, etc... I shut my trap at may employees as well, and of course I LOVE THEM ;), who ever they are. If they think that brings them the income, so be it. But, sometimes I have the feeling that some of you are not just pretending these things for practical considerations, but you indeed think it seriously! And that's creepy. Since when should people respect things that are bad, and since when it's not professional to call the sh*t to what it is? Especially in private??? Come on! I have to puke from all of this liberal bullshit when someone honestly believes these. How can someone be such a... eh. And then you felt you have to report it on the list, or what was that??? And then... this "When Nathan Bubna wrote me"... I know it's not the same case, but I can't help but remember when on another ASF list I was critical about a certain technical aspect of a project, in a *professional* but surely firm way, and another user started to discuss the stuff with me as opposed to trying to gently ridicule the issue. And later he wrote me in private, that he wont continue, because his employer, whose company was connected with some key personal at the ASF project, was told him that, well, it was a wrong thing that he has talked to me. He was almost angry with me because I got him into trouble. God... You see, poor guy was all time there on the list, but he didn't realize I was internally declared to be persona non garta (it seems...), and he talked to me! What a mistake! :) Monday, March 10, 2008, 3:46:39 AM, Adrian Tarau wrote: Jonathan, I must confess you are above my expectations/past experiences. When I post your "nice words" on the mailing list(development list by the way) I didn't knew who you are. I thought you are just a regular user(or even a FreeMarker commiter) who is way to passionate about FreeMarker and tries to trash the Velocity name just because he had a bad experience with Velocity. When Nathan Bubna wrote me and told me who you are, I realized I just started some old war between Velocity and FreeMarker(after I read some of your old posts).So there was not my intention to trash the FreeMarker lead developer name because *I didn't knew who you are*. World like "dipshit", "despicable", don't sit very well near "lead developer" or even "software engineer". I would expect something like this in a bar, but not on a mailing list. Reading your last post, I realized you don't get it and probably you don't understand the concept. !!!IT'S ALL ABOUT RESPECT!!!. I don't care how many bad designs or weak points has Velocity, you should treat the Velocity community, the current developers, past and current owners with RESPECT. Jonathan , there are other ways to bring new users to FreeMarker...your way is completely wrong. You, as a (past) Velocity user are entitled to wrote about your bad experiences with Velocity and thanks to the current search engines your words will be "visible" in the first 100 results in any search engine. If the Velocity developers won't take action to improve the engine and all those bad experiences will pile up, Velocity will die by itself, you don'
RE: Call a velocity macro
I take my hat off to all current, previous and prospective OS developers. Clearly without the collective input and ideas this developer community contributes to projects such as Velocity, software development as a respected profession will struggle to earn a reputation as an innovative vehicle which drives results. I joined this mailing list in the hope I would gain access to a bank of experienced developers by which of course I could draw on and develop my own skills and techniques. After reading these posts, I am not convinced these mailing lists are an appropriate tool which facilitates active and constructive participation. I will not be recommending this to my professional colleagues within the industry. Many Thanks Steven Yates -Original Message- From: Daniel Dekany [mailto:[EMAIL PROTECTED] Sent: Monday, 10 March 2008 3:51 PM To: Velocity Developers List Subject: Re: Call a velocity macro :D Hilarious! I mean, everybody knows Jonathan is an ass hole for his doing this aggressive "advertising" here, and I told him back then for several occasions to stop it (I'm a FreeMarker contributor... coming from the side of the SATAN , you know), but what he brings out of you guys worths all the face loss of the FM project. :) I understand that ass licking and being Politically Correct and things like that are very important for being "professional", means, for a good career. I can handle that, life is that disgusting and cruel, etc... I shut my trap at may employees as well, and of course I LOVE THEM ;), who ever they are. If they think that brings them the income, so be it. But, sometimes I have the feeling that some of you are not just pretending these things for practical considerations, but you indeed think it seriously! And that's creepy. Since when should people respect things that are bad, and since when it's not professional to call the sh*t to what it is? Especially in private??? Come on! I have to puke from all of this liberal bullshit when someone honestly believes these. How can someone be such a... eh. And then you felt you have to report it on the list, or what was that??? And then... this "When Nathan Bubna wrote me"... I know it's not the same case, but I can't help but remember when on another ASF list I was critical about a certain technical aspect of a project, in a *professional* but surely firm way, and another user started to discuss the stuff with me as opposed to trying to gently ridicule the issue. And later he wrote me in private, that he wont continue, because his employer, whose company was connected with some key personal at the ASF project, was told him that, well, it was a wrong thing that he has talked to me. He was almost angry with me because I got him into trouble. God... You see, poor guy was all time there on the list, but he didn't realize I was internally declared to be persona non garta (it seems...), and he talked to me! What a mistake! :) Monday, March 10, 2008, 3:46:39 AM, Adrian Tarau wrote: > Jonathan, > > I must confess you are above my expectations/past experiences. When > I post your "nice words" on the mailing list(development list by the > way) I didn't knew who you are. I thought you are just a regular > user(or even a FreeMarker commiter) who is way to passionate about > FreeMarker and tries to trash the Velocity name just because he had a bad experience with Velocity. > When Nathan Bubna wrote me and told me who you are, I realized I > just started some old war between Velocity and FreeMarker(after I > read some of your old posts).So there was not my intention to trash > the FreeMarker lead developer name because *I didn't knew who you are*. > > World like "dipshit", "despicable", don't sit very well near "lead > developer" or even "software engineer". I would expect something > like this in a bar, but not on a mailing list. > > Reading your last post, I realized you don't get it and probably > you don't understand the concept. !!!IT'S ALL ABOUT RESPECT!!!. > I don't care how many bad designs or weak points has Velocity, you > should treat the Velocity community, the current developers, past > and current owners with RESPECT. Jonathan , there are other ways to > bring new users to FreeMarker...your way is completely wrong. > > You, as a (past) Velocity user are entitled to wrote about your bad > experiences with Velocity and thanks to the current search engines > your words will be "visible" in the first 100 results in any search > engine. If the Velocity developers won't take action to improve the > engine and all those bad experiences will pile up, Velocity will die > by itself, you don't need to help it. Or you could help, but do it in a different way. > > Try to get this and you wi
Re: Call a velocity macro
Monday, March 10, 2008, 1:21:59 PM, Geir Magnusson Jr. wrote: > Steven, > > Don't judge this community by this thread - we have a long history of > constructive and positive collaborative development. Right... with results like Velocity. It speaks for itself. (And may I notice, what a typical corporal bullshit you are saying.) > Give it another chance. > > geir -- Best regards, Daniel Dekany - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
As a matter of fact, he didn't said anything bad about you, just told me who you are and what's your hobby on Velocity mailing list. You can ask him for the complete message. Comparing his message with your message I can tell you there is a huge gap between you and him. This is my last posting on this thread, we don't get anywhere with this discussions. I already sent my apologies, you can take them or not. You can believe me or not, that's your choice. It is clear to me, you don't know what respect means so it will be useless to continue this discussion. Good luck with ... everything... Jonathan Revusky wrote: Adrian Tarau wrote: Jonathan, I must confess you are above my expectations/past experiences. When I post your "nice words" on the mailing list(development list by the way) I didn't knew who you are. I thought you are just a regular user(or even a FreeMarker commiter) who is way to passionate about FreeMarker and tries to trash the Velocity name just because he had a bad experience with Velocity. When Nathan Bubna wrote me and told me who you are, You have me at a disadvantage on that. I have no idea what Nathan Bubna would have said. I tend to assume that it would be a very biased, distorted version of reality. I realized I just started some old war between Velocity and FreeMarker(after I read some of your old posts). That's interesting. Here's a question. In examining those various old posts of mine, do you ever see anybody taking issue with anything I say there on factual grounds? So there was not my intention to trash the FreeMarker lead developer name because *I didn't knew who you are*. World like "dipshit", "despicable", don't sit very well near "lead developer" or even "software engineer". WTF do you think this is? Some kind of limp-wristed high society tea party? Yeah, I called you a little dipshit. You posted a private message on a public forum. And then you told a pathetically obvious lie about it afterwards, saying that you responded "automatically", when, of course, an automatic response would have just been sent to me, since that's what reply-to would have done... in general, if you behave like a complete jerk, posting private email messages on the public forum and stuff like that, see what happens. Try pulling that stunt in various open source communities. I think you'll find that my response was on the more civil end of the spectrum. I would expect something like this in a bar, but not on a mailing list. Reading your last post, I realized you don't get it and probably you don't understand the concept. !!!IT'S ALL ABOUT RESPECT!!!. Adrian, you're a very confused individual. You keep saying things that show that you have some real conceptual issues. Respect is not something owed as a matter of course. Respect is something you earn. In particular, that's how the open source world works, you earn respect. And, for better or worse, it's a world where fools are not suffered gladly. Respect is earned and the people in question have done less than nothing to earn my respect. (And one certainly doesn't earn my respect by posting my private emails to a public forum.) I don't care how many bad designs or weak points has Velocity, you should treat the Velocity community, the current developers, past and current owners with RESPECT. Well, even if any of these people had ever done anything to earn my respect (which they definitely haven't) that would be no reason for me to be less than honest in a private note about Velocity. It is basically junk. I don't think that, before you posted my private email, I had ever said anything like that on a public forum. But since the cat is out of the bag, yeah, that is my honest technically based opinion. I mean, it's TERRIBLE, it's SHOCKINGLY BAD. The first time I really looked closely at the guts of Velocity was when I wrote this utility that converts VTL to FTL. It works by building up the syntax tree using Velocity code and then spitting it out in FTL. So I had to look at Velocity innards closely. I had never had such a high opinion of the thing, but that was a real eye-opener to see how shockingly bad it was, the way certain things were implemented You know, probably there is no way to make it significantly better without undertaking a complete rewrite. That's just the truth. The emperor is not wearing any clothes. Jonathan Revusky - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
I agree, don't judge any online community based on guys like Jonathan. Just ignore them... Geir Magnusson Jr. wrote: Steven, Don't judge this community by this thread - we have a long history of constructive and positive collaborative development. Give it another chance. geir On Mar 10, 2008, at 8:05 AM, Yates Family wrote: I take my hat off to all current, previous and prospective OS developers. Clearly without the collective input and ideas this developer community contributes to projects such as Velocity, software development as a respected profession will struggle to earn a reputation as an innovative vehicle which drives results. I joined this mailing list in the hope I would gain access to a bank of experienced developers by which of course I could draw on and develop my own skills and techniques. After reading these posts, I am not convinced these mailing lists are an appropriate tool which facilitates active and constructive participation. I will not be recommending this to my professional colleagues within the industry. Many Thanks Steven Yates -Original Message- From: Daniel Dekany [mailto:[EMAIL PROTECTED] Sent: Monday, 10 March 2008 3:51 PM To: Velocity Developers List Subject: Re: Call a velocity macro :D Hilarious! I mean, everybody knows Jonathan is an ass hole for his doing this aggressive "advertising" here, and I told him back then for several occasions to stop it (I'm a FreeMarker contributor... coming from the side of the SATAN , you know), but what he brings out of you guys worths all the face loss of the FM project. :) I understand that ass licking and being Politically Correct and things like that are very important for being "professional", means, for a good career. I can handle that, life is that disgusting and cruel, etc... I shut my trap at may employees as well, and of course I LOVE THEM ;), who ever they are. If they think that brings them the income, so be it. But, sometimes I have the feeling that some of you are not just pretending these things for practical considerations, but you indeed think it seriously! And that's creepy. Since when should people respect things that are bad, and since when it's not professional to call the sh*t to what it is? Especially in private??? Come on! I have to puke from all of this liberal bullshit when someone honestly believes these. How can someone be such a... eh. And then you felt you have to report it on the list, or what was that??? And then... this "When Nathan Bubna wrote me"... I know it's not the same case, but I can't help but remember when on another ASF list I was critical about a certain technical aspect of a project, in a *professional* but surely firm way, and another user started to discuss the stuff with me as opposed to trying to gently ridicule the issue. And later he wrote me in private, that he wont continue, because his employer, whose company was connected with some key personal at the ASF project, was told him that, well, it was a wrong thing that he has talked to me. He was almost angry with me because I got him into trouble. God... You see, poor guy was all time there on the list, but he didn't realize I was internally declared to be persona non garta (it seems...), and he talked to me! What a mistake! :) Monday, March 10, 2008, 3:46:39 AM, Adrian Tarau wrote: Jonathan, I must confess you are above my expectations/past experiences. When I post your "nice words" on the mailing list(development list by the way) I didn't knew who you are. I thought you are just a regular user(or even a FreeMarker commiter) who is way to passionate about FreeMarker and tries to trash the Velocity name just because he had a bad experience with Velocity. When Nathan Bubna wrote me and told me who you are, I realized I just started some old war between Velocity and FreeMarker(after I read some of your old posts).So there was not my intention to trash the FreeMarker lead developer name because *I didn't knew who you are*. World like "dipshit", "despicable", don't sit very well near "lead developer" or even "software engineer". I would expect something like this in a bar, but not on a mailing list. Reading your last post, I realized you don't get it and probably you don't understand the concept. !!!IT'S ALL ABOUT RESPECT!!!. I don't care how many bad designs or weak points has Velocity, you should treat the Velocity community, the current developers, past and current owners with RESPECT. Jonathan , there are other ways to bring new users to FreeMarker...your way is completely wrong. You, as a (past) Velocity user are entitled to wrote about your bad experiences with Velocity and thanks to the current search engines your words will be "visible" in the first 100 results in any search engine. If the Velocity developers won't take action
Re: Call a velocity macro
--- Adrian Tarau <[EMAIL PROTECTED]> wrote: > I agree, don't judge any online community based on > guys like Jonathan. > Just ignore them... funny thig is, it' s spillover from completely different community ;) [ Konstantin Pribluda http://www.pribluda.de ] JTec quality components: http://www.pribluda.de/projects/ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Konstantin Priblouda wrote: --- Adrian Tarau <[EMAIL PROTECTED]> wrote: I agree, don't judge any online community based on guys like Jonathan. Just ignore them... funny thig is, it' s spillover from completely different community ;) What different community? What are you talking about? The origin of this thread is Adrian responding to my private note on a public list, this one. The poor boy thought it was so shocking that I said that Velocity (and I was quite specific referring to its macro system) as "junk" in a private note, it was so shocking that he just had to reply to me in a lecturing tone *in public*!!! And then this guy continually lies subsequently, that he had heatedly written a response to me "automatically". If he'd done that, he would have hit "reply-to" and would have answered in private. He then later referred to my private email as a rant, he had never seen anything like that in 8 years! THat was really a lie, I mean, what I wrote him in private a technically focused note. I'm going to provide it again so you see what kind of snivelling lying scum this guy is. The text of my "rant" (according to Adrian) follows: -- Adrian Tarau wrote: > I've always used #if to implement the 'switch' but I think, even for 3-4 > conditions, the template will look cleaner. > > Instead of > > #if('renderLabel' == $macroToCall) > #renderLabel($component) > #elseif('renderInput' == $macroToCall) > #renderInput($component) > #elseif(...) > ... > #end > > we will have > > #call($macroToCall $component). This kind of thing is trivial in FreeMarker. For example, suppose you had: <#assign macroHash = {'renderLabel' : labelMacro, 'renderInput' : renderMacro, > and then, supposing you have an action string, like suppose: [#assign action = 'renderLabel'] then you could invoke the macro via: <@macroHash[action] component /> The thing is that macros in FreeMarker are variables, and can be in hashes or assigned to variables or whatever, and also the foo in <@foo/> to invoke the macro can be any arbitrary expression. So, for example, suppose the macro you want to invoke is in the string macroName, you could invoke it via: <@.vars[macroName] component/> (.vars is a special built-in hash that contains the variables available in the template and since macros are variables as well, .vars[macroName] is the macro with the name macroName and it can be invoked this way, or you could create a variable. <#assign myMacro = .vars[macroName]> and invoke it via: <@myMacro component/> Well, in general, once you want to do anything moderately complex with velocimacros, the thing breaks because it's junk. :-) Here is a blog entry I wrote regarding some of this sort of thing: http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html [ Konstantin Pribluda http://www.pribluda.de ] JTec quality components: http://www.pribluda.de/projects/ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Geir Magnusson Jr. wrote: Steven, Don't judge this community by this thread - we have a long history of constructive and positive collaborative development. Not really. For the last 5 or 6 years, Velocity has basically been a dead project. Okay, you can point to a whole history of point releases, but if you actually look underneath that, you'll see that the amount of forward progress in the last 5 years is an amount of work that one motivated person could do in a week or so. Probably less. Tell me, what was the last significant feature added to Velocity? Obviously, if you don't do hardly anything for 5 or 6 years, it is quite unlikely that your offering will be competitive in its space. And of course, it's not. Give it another chance. He should give open source another chance maybe, but this specific community has precious little to offer. The product is just technically obsolete. Sure, It may not be nice for me to just say that, but at least what I'm saying is true. Doesn't the fact that nobody cares to rebut any of it strongly suggest that? And you can verify it for yourself. What's really really not very nice is to be pushing something as if it was state of the art when it's obsolete. It shows a blatant disregard for the value of other people's time. You really only see this in something like ASF because people have all these careerist motivations for getting involved. Mark Twain famously said that a literary classic is a book that everybody wants to have read but nobody wants to read. Here, and in ASF specifically, you have a lot of people who want to be open source hackers, but don't actually want to hack any code. A couple of years back, I was struck by something. I happened on the personal (or business, really) web page of one of the Struts committers. I won't say which one. It was just Struts this, Struts that. The guy had written books on Struts, had a training course, where for some money he'd come and teach you or your employees Struts. And obviously, it was prominently mentioned that the guy is a committer on the Struts project. Now, at that time (before Struts 1 was officially abandoned and they took over Webwork and called it Struts 2) Struts had not had any forward movement for at least 3 years. It was really a dead project, going nowhere. But that Struts committer was really into being Mr. Struts and making all this business out of it. But in several years, he and the other Struts guys (and we're talking about at least a dozen of them!) had really done basically nothing on the project. And, you know, meanwhile, people had been putting all kinds of work into web app frameworks. Almost any web app framework out there was vastly superior to Struts technically. You see, the relationship of these people to the project was not really that they wanted to get in there and hack the code. It was about self-publicity. To be a Struts committer, and from the point of view of marketing, who better to buy a Struts course from than a Struts committer? And so on. It was about self-promotion. There was no motivation on their part to actually do any work on the project. I don't think you see this kind of thing so much in a non-ASF project, that's just something on sourceforge or something. People don't feel this great need to pretend that a dead, technically obsolete project is active and cutting edge and so on, if it's not. Obviously, there are tons of projects there that are just abandoned, but, you know, it's obvious. The mailing list is dead, and nobody has put up a new release in or committed any code for 5 years and so on. In Velocity (and Struts 1.x was this way too) you have the external trappings of an active project, because it's important to maintain the image that it is active. However, if you actually look at it, you see that the current codebase is almost identical to what it was 5 years previously. Actually, logically speaking, these projects *must* be obsolete technically. I mean, there has to be the notion of an approximate state of the art in a space. And people do things and come up with new ideas. Things move forward. If you do nothing for years, you're not going to have something competitive to offer. The thing is that, what I've been saying here, people out there basically know it. I know from all kinds of private correspondence with people that they see things about the way I've been outlining. It's that it's politically incorrect to say it out loud. Well, I'm not a very politically correct person. My advice is that if you are looking to getting involved in open source, whether as a non-contributing user, or actively contributing, you really want to avoid these kinds of projects where the people are involved with it primarily as a self-promotion device. You want to find projects where the people who are involved just love hacking the code and creating stuff. There's not only that, but I thin
Re: Call a velocity macro
Can someone please shut this guy up. Who is the moderator of this list ? Jonathan Revusky wrote: Geir Magnusson Jr. wrote: Steven, Don't judge this community by this thread - we have a long history of constructive and positive collaborative development. Not really. For the last 5 or 6 years, Velocity has basically been a dead project. Okay, you can point to a whole history of point releases, but if you actually look underneath that, you'll see that the amount of forward progress in the last 5 years is an amount of work that one motivated person could do in a week or so. Probably less. Tell me, what was the last significant feature added to Velocity? Obviously, if you don't do hardly anything for 5 or 6 years, it is quite unlikely that your offering will be competitive in its space. And of course, it's not. Give it another chance. He should give open source another chance maybe, but this specific community has precious little to offer. The product is just technically obsolete. Sure, It may not be nice for me to just say that, but at least what I'm saying is true. Doesn't the fact that nobody cares to rebut any of it strongly suggest that? And you can verify it for yourself. What's really really not very nice is to be pushing something as if it was state of the art when it's obsolete. It shows a blatant disregard for the value of other people's time. You really only see this in something like ASF because people have all these careerist motivations for getting involved. Mark Twain famously said that a literary classic is a book that everybody wants to have read but nobody wants to read. Here, and in ASF specifically, you have a lot of people who want to be open source hackers, but don't actually want to hack any code. A couple of years back, I was struck by something. I happened on the personal (or business, really) web page of one of the Struts committers. I won't say which one. It was just Struts this, Struts that. The guy had written books on Struts, had a training course, where for some money he'd come and teach you or your employees Struts. And obviously, it was prominently mentioned that the guy is a committer on the Struts project. Now, at that time (before Struts 1 was officially abandoned and they took over Webwork and called it Struts 2) Struts had not had any forward movement for at least 3 years. It was really a dead project, going nowhere. But that Struts committer was really into being Mr. Struts and making all this business out of it. But in several years, he and the other Struts guys (and we're talking about at least a dozen of them!) had really done basically nothing on the project. And, you know, meanwhile, people had been putting all kinds of work into web app frameworks. Almost any web app framework out there was vastly superior to Struts technically. You see, the relationship of these people to the project was not really that they wanted to get in there and hack the code. It was about self-publicity. To be a Struts committer, and from the point of view of marketing, who better to buy a Struts course from than a Struts committer? And so on. It was about self-promotion. There was no motivation on their part to actually do any work on the project. I don't think you see this kind of thing so much in a non-ASF project, that's just something on sourceforge or something. People don't feel this great need to pretend that a dead, technically obsolete project is active and cutting edge and so on, if it's not. Obviously, there are tons of projects there that are just abandoned, but, you know, it's obvious. The mailing list is dead, and nobody has put up a new release in or committed any code for 5 years and so on. In Velocity (and Struts 1.x was this way too) you have the external trappings of an active project, because it's important to maintain the image that it is active. However, if you actually look at it, you see that the current codebase is almost identical to what it was 5 years previously. Actually, logically speaking, these projects *must* be obsolete technically. I mean, there has to be the notion of an approximate state of the art in a space. And people do things and come up with new ideas. Things move forward. If you do nothing for years, you're not going to have something competitive to offer. The thing is that, what I've been saying here, people out there basically know it. I know from all kinds of private correspondence with people that they see things about the way I've been outlining. It's that it's politically incorrect to say it out loud. Well, I'm not a very politically correct person. My advice is that if you are looking to getting involved in open source, whether as a non-contributing user, or actively contributing, you really want to avoid these kinds of projects where the people are involved with it primarily as a self-promotion device. You want to find projects where the peopl
Re: Call a velocity macro
Yates Family wrote: I take my hat off to all current, previous and prospective OS developers. Clearly without the collective input and ideas this developer community contributes to projects such as Velocity, software development as a respected profession will struggle to earn a reputation as an innovative vehicle which drives results. Very long sentence that. I'm not sure what you're saying. I joined this mailing list in the hope I would gain access to a bank of experienced developers by which of course I could draw on and develop my own skills and techniques. After reading these posts, I am not convinced these mailing lists are an appropriate tool which facilitates active and constructive participation. I will not be recommending this to my professional colleagues within the industry. Yeah, well, I guess you heard about this open source stuff. Free software, you don't have to pay for it, and if you can't figure out how to things (or are too lazy to figure it out) you can get on one of these lits and people will give you technical tips and explain stuff to you. For free. It sounded like a great deal. What they didn't tell you, though, was that you actually end up interacting with other human beings. They should have warned you about that. But, you know, everything has a catch... Anyway, nothing for you to get worked up about. Relax, go eat some vegemite. I hear that stuff does wonders for the brain. Jonathan Revusky -- lead developer, FreeMarker project, http://freemarker.org/ Velocity or FreeMarker: Looking at 5 Years of Practical Experience http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
On Sun, 2008-03-09 at 18:21 +0100, Jonathan Revusky wrote: > Adrian, you little dipshit, ... To the moderator of this forum: doesn't this language constitute grounds for banning this person from these lists? Thanks and best regards, -- Gonzalo Diethelm [EMAIL PROTECTED]
Re: Call a velocity macro
Gonzalo Diethelm wrote: On Sun, 2008-03-09 at 18:21 +0100, Jonathan Revusky wrote: Adrian, you little dipshit, ... To the moderator of this forum: doesn't this language constitute grounds for banning this person from these lists? You seriously are proposing banning somebody (me in this instance) for calling somebody a dipshit? (Especially after the dipshit in question posted a private message to a public forum to try to embarrass that person?) And to make matters worse, the little dipshit told at least a couple of transparent lies afterwards to try to justify himself, like the bit about how I wrote some incredible rant to him in private that was so shocking, he'd never seen anything like this in 8 years... there's no generous interpretation of that, he was just lying So... schematically: a guy breaches nettiquette by posting a private message in public and subsequently tells lies about the incident, and you're going to ban not that individual, but the person at the receiving end who tells him off. Anyway, nobody would believe that your grounds for banning me (calling the dipshit a dipshit) were the real grounds. They'd see me pointing out quite truthfully the state of this project and know perfectly well that that was the reason for the banning. Jonathan Revusky -- lead developer, FreeMarker project, http://freemarker.org/ Velocity or FreeMarker: Looking at 5 Years of Practical Experience http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html Thanks and best regards, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Well Jonathan gives me another good reason to use velocity Thanks Jonathan!! Jonathan Revusky wrote: Gonzalo Diethelm wrote: On Sun, 2008-03-09 at 18:21 +0100, Jonathan Revusky wrote: Adrian, you little dipshit, ... To the moderator of this forum: doesn't this language constitute grounds for banning this person from these lists? You seriously are proposing banning somebody (me in this instance) for calling somebody a dipshit? (Especially after the dipshit in question posted a private message to a public forum to try to embarrass that person?) And to make matters worse, the little dipshit told at least a couple of transparent lies afterwards to try to justify himself, like the bit about how I wrote some incredible rant to him in private that was so shocking, he'd never seen anything like this in 8 years... there's no generous interpretation of that, he was just lying So... schematically: a guy breaches nettiquette by posting a private message in public and subsequently tells lies about the incident, and you're going to ban not that individual, but the person at the receiving end who tells him off. Anyway, nobody would believe that your grounds for banning me (calling the dipshit a dipshit) were the real grounds. They'd see me pointing out quite truthfully the state of this project and know perfectly well that that was the reason for the banning. Jonathan Revusky -- Matthijs Lambooy CrossmarX BV, Amsterdam http://www.crossmarx.com +31654771926 skype callto://matthijslambooy xmpp:[EMAIL PROTECTED] Winnaar Development Tools 2006 en 2007: http://www.crossmarx.com/radrace - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Go Velocity yea! Matthijs Lambooy wrote: Well Jonathan gives me another good reason to use velocity Thanks Jonathan!! Jonathan Revusky wrote: Gonzalo Diethelm wrote: On Sun, 2008-03-09 at 18:21 +0100, Jonathan Revusky wrote: Adrian, you little dipshit, ... To the moderator of this forum: doesn't this language constitute grounds for banning this person from these lists? You seriously are proposing banning somebody (me in this instance) for calling somebody a dipshit? (Especially after the dipshit in question posted a private message to a public forum to try to embarrass that person?) And to make matters worse, the little dipshit told at least a couple of transparent lies afterwards to try to justify himself, like the bit about how I wrote some incredible rant to him in private that was so shocking, he'd never seen anything like this in 8 years... there's no generous interpretation of that, he was just lying So... schematically: a guy breaches nettiquette by posting a private message in public and subsequently tells lies about the incident, and you're going to ban not that individual, but the person at the receiving end who tells him off. Anyway, nobody would believe that your grounds for banning me (calling the dipshit a dipshit) were the real grounds. They'd see me pointing out quite truthfully the state of this project and know perfectly well that that was the reason for the banning. Jonathan Revusky - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
You deserve it, guys! Jesus... :) Monday, March 10, 2008, 8:33:59 PM, csanders wrote: > Go Velocity yea! > > Matthijs Lambooy wrote: >> Well Jonathan gives me another good reason to use velocity >> >> Thanks Jonathan!! [snip] -- Best regards, Daniel Dekany - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Daniel Dekany wrote: Sunday, March 9, 2008, 6:21:20 PM, Jonathan Revusky wrote: [snip] 7 years ago (maybe closer to 8 years ago) Velocity was written by Jon "Monkey see, Monkey do" Stevens as a copycat clone of an existing open source project called WebMacro. [snip] But Jonathan... you Don't Get It: It's the Apache Way! :-> [snip] pretty obvious that Velocity, like Struts 1.x and other obsolete things, [snip] Velocity is not obsolete. It's just a poor quality stuff starting from its very beginning, as it's made by incompetent/talentless people OR It's not so much that, I don't think. I mean, a lot of the design and implementation mistakes in Velocity are normal for a first-pass implementation of something. Okay, there are supremely talented people (somewhere) whose design and implementation of something on a first pass is near perfect. But that's hardly anybody, not me, and certainly not the people who wrote Velocity. It's normal that you don't do things the best way on a first pass and later, you see cleaner, more efficient, more flexible ways of writing the code. That's what refactoring is about. The real problem is that there was a first pass implementation, but there never was a proper second pass, so you have implementation mistakes in there that are just colossal, and nothing ever done about it. If what Geir said was true, that what you have here is the result of 7 or 8 years of fairly continual collaborative development, the result of that would be extremely unflattering to the talents of the people involved. Well, I mean, this gets into what open source is about or supposed to be about, one idea being that you can achieve surprising levels of quality by opening up the code via the phenomenon of more eyeballs. Something about that isn't really working in Velocityland. But the thing is that more eyeballs works for catching nth order bugs where the source of the bugs is fairly easily localizable to a few lines of code, say. More eyeballs doesn't fix first order errors in overall design and implementation. To fix these things, you need people to take ownership and of course, nobody really does. Like, that whole whitespace debate. Somebody tells me that they resolved in late 2001 or something that it should work a certain way (basically the way it works in FreeMarker) but nobody took ownership. What you had in FreeMarker was not so much the more eyeballs, but you had people taking ownership of big pieces of the code and reworking them. Basically, that's never happened in the history of Velocity. by people who were not interested in the topic. :-) Yeah, you got it right the second time. They're not that genuinely interested in the space. That's why somebody talks about macros that can have an associated block, which has been in FreeMarker for 5 or 6 years, and is in JSP 2.x since I don't know when, and elsewhere surely, and, it's like, this radical new idea. If you're interested in an application space, you know, you basically keep up with what's going on there. Lurking on this forum, I've never really sensed a genuine interest in the problem space on the part of the project owners. (It's not to say that FreeMarker is good, because it's *bad*... but obviously less so than Velocity is.) Well, if you say FreeMarker is bad, it's bad on some completely different plane. It means that there are things you can validly critique. Yes, definitely. But, you of all people know that there really has been a continual effort to remedy these things. Just compare the current version in 2.4HEAD to the first version you ever saw, probably 2.0 or a preview of 2.1. It's night and day. It's a much much more capable tool than it was then. But even then, all that progress started from a starting point that was significantly superior to Velocity's current state. What you have in Velocity is just amazing stuff, like passing macro parameters as strings and reparsing those strings every time the parameter is referenced. And if the parameter is another macro, say, you expand the macro and walk its parse tree every time the parameter is referenced in the first macro. And, of course, when you pass parameters like that (the normal thing is to pass by value) typical programming stuff like recursion doesn't work. Or just ridiculous default behaviors. Like, if somebody writes #set($x = $y) and $y is null, it just does nothing. It doesn't set $x to null, it doesn't thrown an exception, just does nothing. Think of all the time some people around the world must have spent tearing out their hair because they have a line like that in some loop and it just does nothing and they don't understand why their code doesn't work. And just surprisingly silly implementation mistakes, like deciding based on information at parse-time whether something is a macro invocation or just plain text. So the thing sees #foo() and decides this is plain text because it doesn't
Re: Call a velocity macro
Matthijs Lambooy wrote: Well Jonathan gives me another good reason to use velocity How is that a reason to use Velocity? I know you're trying to tell me off (and suck up to the people you feel are the relevant authority figures) but it's unsettling that there isn't even the slightest attempt at logical (or pseudological) discourse. Summary: A dipshit writes a response to my private message in public and I tell him off and another self-righteous ass says I should be banned for telling him off. And that's a "good reason" for you to use Velocity. I mean, there's no logical connection anywhere. It's like: "The socialists were just reelected in Spain." "That's a good reason to use Velocity." "Damn right." Why don't you just say "Yer mommy wears army boots!" or something. At least it's something of an insult (at the primary school level anyway...) Or really, try to make some technical argument in defense of how great Velocity supposedly is, we could talk about that... Thanks Jonathan!! You're welcome, I guess Oh, here are a couple more good reasons for people to use Velocity. The price of crude oil is at a record high. Pamela Anderson still has big tits. Jonathan Revusky -- lead developer, FreeMarker project, http://freemarker.org/ Velocity or FreeMarker: Looking at 5 Years of Practical Experience http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html Jonathan Revusky wrote: Gonzalo Diethelm wrote: On Sun, 2008-03-09 at 18:21 +0100, Jonathan Revusky wrote: Adrian, you little dipshit, ... To the moderator of this forum: doesn't this language constitute grounds for banning this person from these lists? You seriously are proposing banning somebody (me in this instance) for calling somebody a dipshit? (Especially after the dipshit in question posted a private message to a public forum to try to embarrass that person?) And to make matters worse, the little dipshit told at least a couple of transparent lies afterwards to try to justify himself, like the bit about how I wrote some incredible rant to him in private that was so shocking, he'd never seen anything like this in 8 years... there's no generous interpretation of that, he was just lying So... schematically: a guy breaches nettiquette by posting a private message in public and subsequently tells lies about the incident, and you're going to ban not that individual, but the person at the receiving end who tells him off. Anyway, nobody would believe that your grounds for banning me (calling the dipshit a dipshit) were the real grounds. They'd see me pointing out quite truthfully the state of this project and know perfectly well that that was the reason for the banning. Jonathan Revusky - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
:-D Jonathan Revusky wrote: Matthijs Lambooy wrote: Well Jonathan gives me another good reason to use velocity How is that a reason to use Velocity? I know you're trying to tell me off (and suck up to the people you feel are the relevant authority figures) but it's unsettling that there isn't even the slightest attempt at logical (or pseudological) discourse. Summary: A dipshit writes a response to my private message in public and I tell him off and another self-righteous ass says I should be banned for telling him off. And that's a "good reason" for you to use Velocity. I mean, there's no logical connection anywhere. It's like: "The socialists were just reelected in Spain." "That's a good reason to use Velocity." "Damn right." Why don't you just say "Yer mommy wears army boots!" or something. At least it's something of an insult (at the primary school level anyway...) Or really, try to make some technical argument in defense of how great Velocity supposedly is, we could talk about that... Thanks Jonathan!! You're welcome, I guess Oh, here are a couple more good reasons for people to use Velocity. The price of crude oil is at a record high. Pamela Anderson still has big tits. Jonathan Revusky -- Matthijs Lambooy CrossmarX BV, Amsterdam http://www.crossmarx.com +31654771926 skype callto://matthijslambooy xmpp:[EMAIL PROTECTED] Winnaar Development Tools 2006 en 2007: http://www.crossmarx.com/radrace - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Monday, March 10, 2008, 9:26:40 PM, Jonathan Revusky wrote: > Daniel Dekany wrote: >> Sunday, March 9, 2008, 6:21:20 PM, Jonathan Revusky wrote: >> >> [snip] >>> 7 years ago (maybe closer to 8 years ago) Velocity was written by Jon >>> "Monkey see, Monkey do" Stevens as a copycat clone of an existing open >>> source project called WebMacro. >> [snip] >> >> But Jonathan... you Don't Get It: It's the Apache Way! :-> >> >> [snip] >>> pretty obvious that Velocity, like Struts 1.x and other obsolete things, >> [snip] >> >> Velocity is not obsolete. It's just a poor quality stuff starting from >> its very beginning, as it's made by incompetent/talentless people OR > > It's not so much that, I don't think. I mean, a lot of the design and > implementation mistakes in Velocity are normal for a first-pass > implementation of something. I disagree. It contained, well, strange language design ideas from the beginning, that no true professional should ever do. But, whatever, nobody cares... -- Best regards, Daniel Dekany - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Jonathan, I was wondering (I don't have anything to do with the Velocity project, I receive this list because I am writing a tool that will allow one my OS projects to be used within Velocity), why not use your energies to lobby Apache to take FreeMarker on-board? You have indicated that FreeMarker is more advanced and mature than Velocity (and from the limited reading I have done it appears that way) but your efforts on the list seem like wasted effort to me. From what I've read the meat of your argument is that you are unhappy that Velocity is considered the de-facto template engine to use because it has the Apache badge and that Joe User doesn't realize that there are better alternatives, if this is the case then an obvious remedy would be to get the FreeMarker project the Apache badge . Just a thought. Gary Jonathan Revusky wrote: Matthijs Lambooy wrote: Well Jonathan gives me another good reason to use velocity How is that a reason to use Velocity? I know you're trying to tell me off (and suck up to the people you feel are the relevant authority figures) but it's unsettling that there isn't even the slightest attempt at logical (or pseudological) discourse. Summary: A dipshit writes a response to my private message in public and I tell him off and another self-righteous ass says I should be banned for telling him off. And that's a "good reason" for you to use Velocity. I mean, there's no logical connection anywhere. It's like: "The socialists were just reelected in Spain." "That's a good reason to use Velocity." "Damn right." Why don't you just say "Yer mommy wears army boots!" or something. At least it's something of an insult (at the primary school level anyway...) Or really, try to make some technical argument in defense of how great Velocity supposedly is, we could talk about that... Thanks Jonathan!! You're welcome, I guess Oh, here are a couple more good reasons for people to use Velocity. The price of crude oil is at a record high. Pamela Anderson still has big tits. Jonathan Revusky - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Gary Bentley wrote: Jonathan, I was wondering (I don't have anything to do with the Velocity project, I receive this list because I am writing a tool that will allow one my OS projects to be used within Velocity), why not use your energies to lobby Apache to take FreeMarker on-board? What for? I have no interest in that. And, especially, now that FreeMarker has the critical mass it has, it would be almost superfluous. There would have been more of a tradeoff, pro vs. con, back when FreeMarker was little known. But at this stage, there are mostly just cons. And, in general, I don't want anything to do with ASF. I consider it to be an extremely dysfunctional organization, at least if you take the idea that it is a non-profit foundation that exists for the public benefit. (If the point of it is to promote the members and their work, independently of merit, then the organization works quite well, but that is mostly to the detriment of the public benefit.) Oh, actually, I wrote a somewhat humorous blog entry about that subject of potentially joining ASF. See: http://freemarker.blogspot.com/2006/02/some-comments-on-joining-jakarta-or.html You have indicated that FreeMarker is more advanced and mature than Velocity (and from the limited reading I have done it appears that way) but your efforts on the list seem like wasted effort to me. Well, what's your basis for thinking that? I mean, there has been a huge migration of users from Velocity towards FreeMarker. Even other Apache projects, which are (though somebody may pop up and deny it) under some pressure to use other ASF projects, tend increasingly to use FreeMarker for templating. Struts 2, Open for Business, for example. I think there are one or two others. Now, I'm not saying that we've reached this point because I occasionally speak my mind on this forum. But OTOH, I don't think you have much evidence that it is ineffective. There is not much evidence either which way on that. From what I've read the meat of your argument is that you are unhappy that Velocity is considered the de-facto template engine to use because it has the Apache badge Well, that's only the case among people for whom that Apache badge means a lot. And, basically, for technically informed people, it surely doesn't mean a lot nowadays. Probably, among people who do some due dilligence on investigating their tool set, FreeMarker is the overwhelming choice by now. You know, the fact that such projects as Netbeans, Hibernate, and Webwork (which is now "Struts 2") used Velocity at some point in the past and then switched to FreeMarker, this tells you something. Any minimal amount of investigation you do by googling around, I think you'll quickly see what's going on. You can find all kinds of cases of people (those very prominent projects among them) who have switched from Velocity to FreeMarker. And you cannot find a single example of anybody going in the other direction. Try it... and that Joe User doesn't realize that there are better alternatives, if this is the case then an obvious remedy would be to get the FreeMarker project the Apache badge . Well, there's some logic to that, but it's a perverse kind of logic. I mean, it's like you have a local farmer's market, and you can buy wonderful fresh fruits and vegetables there. You buy there, but your kids won't eat the stuff. They will only eat fruits and vegetables that come out of a tin can, made by some corporations, that market this tinned food during the cartoons during children's TV shows, using cute cartoon characters. So how do you get the kids to eat the fresh local fruits and vegetables when all they want to eat is the crap from the tin? Well, you figure it out. You convince them that the fresh fruit and vegetables actually came from the tin can and then they'll happily eat it. Yum, yum. (I think it might be better to just try beat some sense into the little brats, but that's not politically correct) I mean, that characterization is about right. Look at what happened with the Struts project. It went nowhere for years, got ever increasingly obsolete. Even without improving for 4 years or so, Struts in 2005 was by far the most popular web application framework. A whole small industry existed around the darned thing: books, training courses, add-on plugins and so on... The problem was that ASF, being the dysfunctional organization it is, the project was basically in a state of abandonment. The committers did no real work on it, and if anybody showed up with a fire in their belly to do some work on it, they gave them the runaround. (You can verify all this, it's true.) Anyway, what happened? They got the developers of a competing web application framework, one that was far technically superior to Struts, to donate their work to ASF, and it got relabelled as Struts 2. This was the deal the Webwork people made to get visibility for their
Re: Call a velocity macro
Tuesday, March 11, 2008, 12:27:00 AM, Jonathan Revusky wrote: [snip] > Now, I'm not saying that we've reached this point because I occasionally > speak my mind on this forum. But OTOH, I don't think you have much > evidence that it is ineffective. There is not much evidence either which > way on that. [snip] As always, you are mistaken in this question. As far as the number of FM users is concerned, or the prosperity of the FM project in general, I'm sure your activity on this list surely has a negative effect. That in general it's hard to be popular if you make negative statements is one thing (psychology...), but that's the unavoidable part. That local Velocity personal will react with some obvious waffle to any real critic is also unavoidable. What other choice do they have after all. However, going into endless flame wars, with subject like "STOP LYING, ADRIAN" is silly. You see, after a few mails, who cares about who-said-what? Nobody will follow, so it's just annoys everyone, and no mater what, I repeat, no mater what, you will be the culprit, because the thing has escalated around you. It's programming the Jonathan => Mess association into the brain of readers, and nobody likes mess. Strong language is also something that most IT people will unconditionally refuse when said in public, together with the guy who said it (out of a kind of snobbism/subconscious-hypocritism anyway). Also, doing too much of FM plugs counts as aggressive behavior, and thus that's repulsive as well, regardless of the alleged helpfulness and correctness of the plug. I'm surely don't known me from being nice and PC, so I hope it has some credibility if I'm saying these. And if you have any reactions to this, rather do it in private. I'm out of this thread. -- Best regards, Daniel Dekany - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro
Daniel Dekany wrote: Tuesday, March 11, 2008, 12:27:00 AM, Jonathan Revusky wrote: [snip] Now, I'm not saying that we've reached this point because I occasionally speak my mind on this forum. But OTOH, I don't think you have much evidence that it is ineffective. There is not much evidence either which way on that. [snip] As always, you are mistaken in this question. As far as the number of FM users is concerned, or the prosperity of the FM project in general, I'm sure your activity on this list surely has a negative effect. You're sure? Okay, fine. But I think my point stands, when I say there's not much evidence either way on that. There just isn't. In any case, it would be marginal since relatively few of the people who use these software tools ever subscribes to the list. Also, there is no doubt that some people do learn of FreeMarker that way and sooner or later switch. In fact, that was your case. But I would never say that that was the majority of new users we get. It's a small minority. That in general it's hard to be popular if you make negative statements is one thing (psychology...), but that's the unavoidable part. That local Velocity personal will react with some obvious waffle to any real critic is also unavoidable. What other choice do they have after all. Well, sure they have a choice. They could behave like adults. And that's real wrinkle in all this. I think you'd have a stronger case with what you're saying if the Velocity people behaved even minimally like grownups. Obviously, what you do if somebody comes by your list and mentions to people who need a given feature that their tool has that feature and yours doesn't, is you say: "Thank you for bringing that to our attention Mr. X. It's always interesting to see what other people are doing in this application space." And then you go look at what the other community has done and think about how to offer something comparable to your users. That's really the only sensible way to react. When you try so hard to get the other guy to shut up and start with all the ad hominem, it can only be a huge loss of face. And, of course, whatever silliness occurs on the Velocity forum, not on our forum, so who is it damaging mostly? And with what do people make the mental association? Stuff like this never happens in our community, but we really do basically behave like adults -- not perfect, mind you, but the prevalent standards of behavior are much higher. Now, of course, if the Velocity people behaved like sensible adults in response, admittedly, I would not be as tempted to participate. It's watching their reactions that is such a wicked bit of fun. And, of course, it's much more damaging to them than it is to us. I've written several truthful posts detailing all kinds of technical problems with Velocity. It's like they barely have the heart to maintain the charade that they're actually interested in this project technically. I mean, they should say either: "Gee, thank you for bringing up those points. It's really helpful to get such a firm critique and we'll work on it." Or say: "Yes, we're aware of these problems, but we're working on it and we'll be steadily improving." But no... they just start with the personal attacks and so on. It's like, if they could just get you to stop mentioning these problems, the problems would cease to exist. And that's really the way these guys think. If you can pass off something shoddy, then it doesn't matter if the quality is lacking. However, going into endless flame wars, with subject like "STOP LYING, ADRIAN" is silly. Well, I dunno, how do you react to somebody who is just blatantly lying? I mean that kind of thing gets beyond regular silliness. You see, after a few mails, who cares about who-said-what? Nobody will follow, so it's just annoys everyone, and no mater what, I repeat, no mater what, you will be the culprit, because the thing has escalated around you. It's programming the Jonathan => Mess association into the brain of readers, and nobody likes mess. Strong language is also something that most IT people will unconditionally refuse when said in public, Aw, c'mon, Daniel, you weren't born yesterday. They don't care about the language I use. That's just a phony pretext. That's another aspect where they make themselves look ridiculous. I mean, you're going to ban somebody for saying little dipshit to somebody who posted your private note on the public forum. together with the guy who said it (out of a kind of snobbism/subconscious-hypocritism anyway). Also, doing too much of FM plugs counts as aggressive behavior, and thus that's repulsive as well, regardless of the alleged helpfulness and correctness of the plug. I'm surely don't known me from being nice and PC, so I hope it has some credibility if I'm saying these. And if you have any reactions to this, rather do it in private. I'm out of this thread. Sure, that's fine. But
Re: Call a velocity macro
Jonathan Revusky wrote: That's really the only sensible way to react. When you try so hard to get the other guy to shut up and start with all the ad hominem, it can only be a huge loss of face. And, of course, whatever silliness occurs on the Velocity forum, not on our forum, so who is it damaging mostly? And with what do people make the mental association? Stuff like this never happens in our community, but we really do basically behave like adults -- not perfect, mind you, but the prevalent standards of behavior are much higher. -- Matthijs Lambooy CrossmarX BV, Amsterdam http://www.crossmarx.com +31654771926 skype callto://matthijslambooy xmpp:[EMAIL PROTECTED] Winnaar Development Tools 2006 en 2007: http://www.crossmarx.com/radrace - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro #stop
Please stop this. Daniel Dekany wrote: Monday, March 10, 2008, 1:21:59 PM, Geir Magnusson Jr. wrote: Steven, Don't judge this community by this thread - we have a long history of constructive and positive collaborative development. Right... with results like Velocity. It speaks for itself. (And may I notice, what a typical corporal bullshit you are saying.) Give it another chance. geir -- Matthijs Lambooy CrossmarX BV, Amsterdam http://www.crossmarx.com +31654771926 skype callto://matthijslambooy xmpp:[EMAIL PROTECTED] Winnaar Development Tools 2006 en 2007: http://www.crossmarx.com/radrace - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro #stop
PLS STOP THIS Jonathan Revusky wrote: Konstantin Priblouda wrote: --- Adrian Tarau <[EMAIL PROTECTED]> wrote: I agree, don't judge any online community based on guys like Jonathan. Just ignore them... funny thig is, it' s spillover from completely different community ;) What different community? What are you talking about? The origin of this thread is Adrian responding to my private note on a public list, this one. The poor boy thought it was so shocking that I said that Velocity (and I was quite specific referring to its macro system) as "junk" in a private note, it was so shocking that he just had to reply to me in a lecturing tone *in public*!!! And then this guy continually lies subsequently, that he had heatedly written a response to me "automatically". If he'd done that, he would have hit "reply-to" and would have answered in private. He then later referred to my private email as a rant, he had never seen anything like that in 8 years! THat was really a lie, I mean, what I wrote him in private a technically focused note. I'm going to provide it again so you see what kind of snivelling lying scum this guy is. The text of my "rant" (according to Adrian) follows: -- Adrian Tarau wrote: > I've always used #if to implement the 'switch' but I think, even for 3-4 > conditions, the template will look cleaner. > > Instead of > > #if('renderLabel' == $macroToCall) > #renderLabel($component) > #elseif('renderInput' == $macroToCall) > #renderInput($component) > #elseif(...) > ... > #end > > we will have > > #call($macroToCall $component). This kind of thing is trivial in FreeMarker. For example, suppose you had: <#assign macroHash = {'renderLabel' : labelMacro, 'renderInput' : renderMacro, > and then, supposing you have an action string, like suppose: [#assign action = 'renderLabel'] then you could invoke the macro via: <@macroHash[action] component /> The thing is that macros in FreeMarker are variables, and can be in hashes or assigned to variables or whatever, and also the foo in <@foo/> to invoke the macro can be any arbitrary expression. So, for example, suppose the macro you want to invoke is in the string macroName, you could invoke it via: <@.vars[macroName] component/> (.vars is a special built-in hash that contains the variables available in the template and since macros are variables as well, .vars[macroName] is the macro with the name macroName and it can be invoked this way, or you could create a variable. <#assign myMacro = .vars[macroName]> and invoke it via: <@myMacro component/> Well, in general, once you want to do anything moderately complex with velocimacros, the thing breaks because it's junk. :-) Here is a blog entry I wrote regarding some of this sort of thing: http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html [ Konstantin Pribluda http://www.pribluda.de ] JTec quality components: http://www.pribluda.de/projects/ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Matthijs Lambooy CrossmarX BV, Amsterdam http://www.crossmarx.com +31654771926 skype callto://matthijslambooy xmpp:[EMAIL PROTECTED] Winnaar Development Tools 2006 en 2007: http://www.crossmarx.com/radrace - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call a velocity macro #stop
Really ya'll take it somewhere else. Matthijs Lambooy wrote: PLS STOP THIS Jonathan Revusky wrote: Konstantin Priblouda wrote: --- Adrian Tarau <[EMAIL PROTECTED]> wrote: I agree, don't judge any online community based on guys like Jonathan. Just ignore them... funny thig is, it' s spillover from completely different community ;) What different community? What are you talking about? The origin of this thread is Adrian responding to my private note on a public list, this one. The poor boy thought it was so shocking that I said that Velocity (and I was quite specific referring to its macro system) as "junk" in a private note, it was so shocking that he just had to reply to me in a lecturing tone *in public*!!! And then this guy continually lies subsequently, that he had heatedly written a response to me "automatically". If he'd done that, he would have hit "reply-to" and would have answered in private. He then later referred to my private email as a rant, he had never seen anything like that in 8 years! THat was really a lie, I mean, what I wrote him in private a technically focused note. I'm going to provide it again so you see what kind of snivelling lying scum this guy is. The text of my "rant" (according to Adrian) follows: -- Adrian Tarau wrote: > I've always used #if to implement the 'switch' but I think, even for 3-4 > conditions, the template will look cleaner. > > Instead of > > #if('renderLabel' == $macroToCall) > #renderLabel($component) > #elseif('renderInput' == $macroToCall) > #renderInput($component) > #elseif(...) > ... > #end > > we will have > > #call($macroToCall $component). This kind of thing is trivial in FreeMarker. For example, suppose you had: <#assign macroHash = {'renderLabel' : labelMacro, 'renderInput' : renderMacro, > and then, supposing you have an action string, like suppose: [#assign action = 'renderLabel'] then you could invoke the macro via: <@macroHash[action] component /> The thing is that macros in FreeMarker are variables, and can be in hashes or assigned to variables or whatever, and also the foo in <@foo/> to invoke the macro can be any arbitrary expression. So, for example, suppose the macro you want to invoke is in the string macroName, you could invoke it via: <@.vars[macroName] component/> (.vars is a special built-in hash that contains the variables available in the template and since macros are variables as well, .vars[macroName] is the macro with the name macroName and it can be invoked this way, or you could create a variable. <#assign myMacro = .vars[macroName]> and invoke it via: <@myMacro component/> Well, in general, once you want to do anything moderately complex with velocimacros, the thing breaks because it's junk. :-) Here is a blog entry I wrote regarding some of this sort of thing: http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html [ Konstantin Pribluda http://www.pribluda.de ] JTec quality components: http://www.pribluda.de/projects/ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]