[ 
https://issues.apache.org/jira/browse/VELOCITY-687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667327#action_12667327
 ] 

Nathan Bubna commented on VELOCITY-687:
---------------------------------------

-1  I'm not at all a fan of adding such a config property.   It will add 
complexity to internal code that is already quite complex.  It will add 
complexity to development and use of velocimacro libraries.  It will add 
complexity to helping macro users on the mailing list, as it adds another 
setting to ask them about.   It changes a very longstanding Velocity behavior.  
And for all that, it doesn't really added any needed new feature.

I don't mind veering away from strict pass by name, as i have already said.  
But i do not think this sort of thing ought to be subject to configuration 
properties.  I just don't think the additional complexity is worth it in this 
case.

> Macro pass by value option
> --------------------------
>
>                 Key: VELOCITY-687
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-687
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.7
>            Reporter: Byron Foster
>
> Add a configuration property which would change macro parameter passing from 
> pass by name, to pass by value.  I think in many instances this option will 
> provide behavior that is more intuitive to the user.  There are two important 
> exceptions to this, references created by #define, and references created by 
> BlockMacro's $bodyContent.   This allows the user to still specify pass by 
> name semantics when desired, for example:
> #define($x) #if($foo)$foo.bar#{else}-None-#end  #end
> #go($x)
> In the above example '#if($foo)$foo.bar#{else}-None-#end' will be passed by 
> name.  In all other cases pass by value rules apply for example:
> #go($foo.bar  [1, 2, 3]  #if($bar)Yes#{else}No#end)
> In the above example all parameters will be evaluated to a value first, then 
> passed to #go.  This has potential performance improvements also.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to