On Fri, Jun 8, 2012 at 2:36 AM, Claude Brisson <[email protected]> wrote:
>> I don't know if the script context itself is to be present in the
>> bindings (i.e. in the Velocity context). If so, we should name it
>> $scriptContext rather than $context, since we already use the later
>> for exposing a Velocity context to itself via the ContextTool.
>
> Update: I read in the specs that:
>
>  << In all cases, the ScriptContext used during a script execution must
>  be a value in the Engine Scope of the ScriptEngine whose key is the
>  String “context”. >>
>
> There are several other keys which are to be defined: argv, filename,
> engine, engine_version, language, language_version (all of which are
> optional, but could be useful).
>
> My proposal is to gather all those keys in a $script object (that is,
> to expose the Bindings in itself under the 'script' key). From what I
> read in the specs, we are free to prefix predefined keys with whatever
> we want.

+1

> The motivation is to:
>  - avoid potential naming collisions. The ContextTool, exposing the
>   Velocity context itself under the $context key, will not necessarily
>   be present, or can be under a different key, but better prevent than
>   cure.
>  - follow our current philosophy to gather properties in a control
>   object, as we already do for macros, loops, ...
>
>
>  Claude
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

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

Reply via email to