cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: flowscript calls from sitemap: named param association
Date Sat, 27 Aug 2005 16:08:46 GMT
Mark Lundquist wrote:

> Hi gang,
>
> For this...
>
>     <map:call function="foo">
>         <map:parameter name="something" value="X" />
>     </map:call>
>
> we deprectated this...
>
>     function foo (something) {...}
>
> and now require this:
>
>     function foo() {
>         var something = cocoon.parameters['something'];
>     }
>
> IIRC this was because the sitemap syntax suggests named parameter 
> association, which is misleading because the actual parameter 
> association is positional, and this was a source of errors.
>
> Looking at the Rhino a little bit... isn't it true that any flowscript 
> function called from the sitemap is going to be an instance of 
> org.mozilla.javascript.InterpretedFunction — not just BaseFunction?  
> If so, then there are methods we can use to obtain the formal 
> parameter name for each parameter of the function (by position).  
> Wouldn't that let us implement real named parameter association in 
> FOM_JavaScriptInterpreter.callFunction()?  Then we could restore the nice
>
>     function foo (something)
>
> form.
>
> Thoughts?


Hmm... this nice feature comes with a price: reliance on the internals 
of the current Rhino, which may change without notice. Furthermore, 
JavaFlow doesn't support this.

So a -1 for this...

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Mime
View raw message