Hi,

Check this out:

jshell> /set mode tinkerpop normal -command
jshell> /set prompt tinkerpop "gremlin> " "   ...> “
jshell> /set format tinkerpop result "==>{value}{post}" 
added,modified,replaced-primary-ok
jshell> /set feedback tinkerpop
|  Feedback mode: tinkerpop
gremlin>
gremlin> g.inject(1L,2L).union(__.incr(),__.incr().incr()).toList()
==>[2, 3, 3, 4]

Pretty chill.

Marko.


> On Mar 19, 2019, at 9:32 AM, Marko Rodriguez <[email protected]> wrote:
> 
> Hi,
> 
> ~ jshell --class-path 
> /Users/marko/.m2/repository/org/apache/tinkerpop/gremlin/4.0.0-SNAPSHOT/gremlin-4.0.0-SNAPSHOT.jar:/Users/marko/.m2/repository/org/apache/tinkerpop/core/4.0.0-SNAPSHOT/core-4.0.0-SNAPSHOT.jar:/Users/marko/.m2/repository/org/apache/tinkerpop/pipes/4.0.0-SNAPSHOT/pipes-4.0.0-SNAPSHOT.jar
> |  Welcome to JShell -- Version 11.0.2
> |  For an introduction type: /help intro
> 
> jshell> /set feedback concise
> jshell> 1+2
> $1 ==> 3
> jshell> import org.apache.tinkerpop.language.gremlin.*
> jshell> import org.apache.tinkerpop.machine.processor.pipes.*
> jshell> TraversalSource<Long> g = 
> Gremlin.<Long>traversal().withProcessor(PipesProcessor.class)
> jshell> g.inject(1L,2L).incr().count()
> $5 ==> [InjectInitial(1,2), IncrMap, CountReduce]
> jshell> g.inject(1L,2L).incr().count().toList()
> $6 ==> [2]
> jshell> /exit
> |  Goodbye
> ~
> 
> /////////////////////////////////
> 
> Supposedly you can create “modules” in Java9+ and thus, if we do that, it 
> would be:
> 
> ~ jshell --module-path ~/modules --add-modules tinkerpop4.module
> 
> Finally, note the "/set feedback concise” option I set. You can design your 
> own feedbacks.
>       
> http://cr.openjdk.java.net/~rfield/tutorial/JShellTutorial.html#defining-a-feedback-mode
>  
> <http://cr.openjdk.java.net/~rfield/tutorial/JShellTutorial.html#defining-a-feedback-mode>
> 
> You can have a startup script and thus, users would do:
> 
> ~ jshell tinkerpop-shell.jsh --module-path ~/modules
> 
> /////////////////////////////////
> 
> I say we don’t build a console for TinkerPop4. 
> 
>       JShell for Gremlin-Java
>       Groovysh for Gremlin-Groovy
>       Python for Gremlin-Python
>       …
> 
> Less code, less documentation, ...
> 
> Take care,
> Marko.
> 
> http://markorodriguez.com <http://markorodriguez.com/>
> 
> 

Reply via email to