velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Glass-Husain <wgl...@forio.com>
Subject Re: macros and "out of scope" variables
Date Thu, 18 May 2006 04:18:04 GMT
Hi Scott,

Only what's defined in the user guide under "Velocimacro 
configuration".  I don't think you can enforce this, no.

WILL

Scott Edward Skinner wrote:
> Hi Velocity people,
>
> Some of the developers I work with have this annoying habit of 
> referencing variables in macros that were not passed to the macros as 
> a parameters. I suppose you could call these global variables and 
> argue that this is perfectly normal, but from my point of view that 
> makes every variable passed from the model to the view a "global" and 
> why have macro params at all? It's useful to be able to look at a 
> macro's params and know that these represent every external variable 
> the macro needs in order to fulfill its logic responsibilities.
>
> So...
>
> Is there any way to enforce scope on macros such that they can only 
> reference the params that are explicitly passed to them?
>
> S     |\_._/|     .-.
> E     | o o |_   / /
> S   _.(  T  ) `./ /
> ---(((-`-(((---------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

-- 
Forio Business Simulations

Will Glass-Husain
phone (415) 440-7500 x89
mobile (415) 235-4293
wglass@forio.com
www.forio.com


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


Mime
View raw message