You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Nathan Bubna (JIRA)" <de...@velocity.apache.org> on 2009/03/12 17:38:50 UTC

[jira] Resolved: (VELOCITY-687) Macro pass by value option

     [ https://issues.apache.org/jira/browse/VELOCITY-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna resolved VELOCITY-687.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0

Seems to me that Byron already made the switch to pass-by-value for 2.0.  I don't think there's anything left to do here, especially since i remain heartily opposed to having this sort of behavior be an "option".

I'm happy how it is, pass-by-name for the remainder of 1.x and pass-by-value for 2.0.

> 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: 2.0
>            Reporter: Byron Foster
>             Fix For: 2.0
>
>         Attachments: value.patch
>
>
> 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: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org