Kulla: Please review JShell API

Paul Sandoz paul.sandoz at oracle.com
Fri Jun 26 12:07:59 UTC 2015


On Jun 25, 2015, at 9:50 PM, Robert Field <robert.field at oracle.com> wrote:

> Please review the API.  The javadocs can be found here:
> 
>    http://cr.openjdk.java.net/~rfield/doc
> 
> Sources (as always) are here:
> 
>    http://hg.openjdk.java.net/kulla/dev
> 
> All comments welcome.
> 

Fun fact: one can test drive the REPL in the REPL, "REPL-is-Eval-Print-Loop" :-)

kulla-dev $ ./build/macosx-x86_64-normal-server-release/images/jdk/bin/jshell
|  Welcome to JShell -- Version 0.610
|  Type /help for help

-> import jdk.jshell.*

-> JShell js = JShell.create(System.in, System.out, System.err);
|  Added variable js of type JShell with initial value jdk.internal.jshell.impl.JShellImpl at 6d00a15d

-> js.eval("Integer.valueOf(1)");
|  Expression value is: [jdk.jshell.KeyStatusEvent at 710f4dc7]
|    assigned to temporary variable $1 of type List<KeyStatusEvent>

-> $1.get(0)
|  Expression value is: jdk.jshell.KeyStatusEvent at 710f4dc7
|    assigned to temporary variable $2 of type KeyStatusEvent

-> $2.value
|  Expression value is: "1"
|    assigned to temporary variable $3 of type String


I have started playing with it. So far it feels like a really solid piece of engineering. The jshell tool has some nice polish with history and auto-completion. Great stuff!

Paul.


More information about the kulla-dev mailing list