[ 
https://issues.apache.org/jira/browse/SLING-1236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794004#action_12794004
 ] 

Michael Dürig commented on SLING-1236:
--------------------------------------

I'd go for a +1 ;-)

- Regarding implicit conversion: I think the issue is minor and can be easily 
worked around when encountered. Without the patch, script authors need to cast 
a variable every time they need to access it on an interface which is not 
explicitly exposed. With the patch casting is only required when a variable 
needs to be eligible for implicit conversion within the script. 

- Regarding caching: This should be fixable using an approach as proposed 
earlier by Reto. I'd rather track this in a separate issue though.



> Scala Scripting: Make all types of the script arguments visible on the Scala 
> side
> ---------------------------------------------------------------------------------
>
>                 Key: SLING-1236
>                 URL: https://issues.apache.org/jira/browse/SLING-1236
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: Michael Dürig
>            Priority: Minor
>         Attachments: SLING-1236.patch
>
>
> Currently the Scala scripting engine inserts a preamble for the bindings 
> passed to a Script. The preamble contains a declaration of the following form 
> for each value in the Bindings instance:
>   val request: SlingHttpServletRequest = 
> bindings.get("request").asInstanceOf[SlingHttpServletRequest]
> The types are hard coded in the ScalaScriptEngine.TypeHints class. For 
> unknown types a declaration of type AnyRef is inserted into the preamble. 
> I suggest to implement a run time type discovery algorithm which discovers 
> the accessible type from a given instance and inserts the respective 
> declarations into the preamble. That way the static coupling between the 
> known values in Bindings and its types would go away. Furthermore the values 
> would be of a type appearing to be of all the visible types on the Scala side.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to