Pass by name does not work with #foreach within a macro
-------------------------------------------------------

                 Key: VELOCITY-630
                 URL: https://issues.apache.org/jira/browse/VELOCITY-630
             Project: Velocity
          Issue Type: Bug
          Components: Engine
    Affects Versions: 1.6-beta1, 1.5
            Reporter: Byron Foster


GIven the following:

#macro(test $a $b)
 #foreach($i in $a) $b #end
#end
#test( [1, 2, 3] "#if($i == 2) yes #else no #end")

I would expect the output:

no  yes  no

Instead, I get

no  no  no

The Foreach directive explicitly sets  $i in the localscope.  This change was 
made for VELOCITY-285 .  Before 285 Velocity correctly gave the results  "no 
yes no" which is svn revision number 471881.




-- 
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