use of jdk.jshell.Snippet in project jdk9-jigsaw by AdoptOpenJDK.
the class JShellSample1 method main.
public static void main(String[] args) {
JShell shell = JShell.builder().idGenerator((snippet, integer) -> "MyID" + integer).build();
shell.eval("int a = 100;");
shell.eval("100 + 100;");
shell.variables().forEach(v -> System.out.println(v.typeName() + " " + v.name() + " " + v.id()));
}