velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Edward Skinner <sskin...@cloud9.net>
Subject macros and "out of scope" variables
Date Wed, 17 May 2006 17:44:52 GMT
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


Mime
View raw message