[ 
https://issues.apache.org/jira/browse/TINKERPOP-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16843915#comment-16843915
 ] 

stephen mallette commented on TINKERPOP-2222:
---------------------------------------------

I'm not sure what should be done to improve this. It's been a while since I've 
worked with sandboxing. I originally built it with the idea that it was a 
reference implementation that could be improved by users or possibly graph 
providers. There are already graph providers who have done just that actually, 
so I'm not sure how much more advanced we should make this feature, but I'm 
also not against the idea of improvements if they are contributed.

> Improve sandbox to avoid GraphTraversal casts
> ---------------------------------------------
>
>                 Key: TINKERPOP-2222
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2222
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: server
>    Affects Versions: 3.3.6
>            Reporter: stephen mallette
>            Priority: Minor
>
> We have the unfortunate situation where sandboxing makes writing Gremlin a 
> bit ugly at times:
> {code}
> gremlin> :> 
> g.V().has('person','name','marko').as('m').constant('x').as('l').addE(select('l')).from(select('m')).to('m')
> Script8.groovy: 1: [Static type checking] - Cannot call 
> org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal 
> <org.apache.tinkerpop.gremlin.structure.Vertex, 
> java.lang.String>#addE(org.apache.tinkerpop.gremlin.process.traversal.Traversal
>  <java.lang.Object extends java.lang.Object, java.lang.String>) with 
> arguments 
> [org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal <A 
> extends java.lang.Object, B extends java.lang.Object>] 
>  @ line 1, column 1.
>    
> g.V().has('person','name','marko').as('m').constant('x').as('l').addE(select('l')).from(select('m')).to('m')
>    ^
> 1 error
> Type ':help' or ':h' for help.
> Display stack trace? [yN]n
> gremlin> :> 
> g.V().has('person','name','marko').as('m').constant('x').as('l').addE((GraphTraversal<Object,String>)select('l')).from(select('m')).to('m')
> ==>e[3][0-x->0]
> {code}
> The inclusion of type checking forces casts like the one shown above which is 
> a bit of an inconvenience. Would be nice if that explicit casting could be 
> avoided at least when dealing with a {{GraphTraversal}} object.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to