Hello,
I think we should introduce an S object. It would stand for Script and would
allow you to do:
S.f(“{ it.length }”)
Where does this come in handy? Language variants.
Imagine using gremlin_python that will compile to Gremlin-Groovy for execution
at GremlinServer.
g.V().out(“knows”)[0:2].name.map(f(“{ it.length }”))
Next, imagine you are in Gremlin-Java and want to submit a traversal to
GremlinServer, but it has a lambda. No worries, just use the GroovyTranslator
and you have:
g.V().out(“knows”).limit(2).values(“name”).map(f(“{ it.length }”))
We could also have:
S.s = supplier
S.c = consumer
S.f = function
S.o = operator
This gets to the general problem of being able to translate lambdas between
different languages as well as being able to send lambdas over the wire.
Thoughts?,
Marko.
http://markorodriguez.com