-
Sub-task
-
Resolution: Fixed
-
P4
-
None
-
b115
-
Verified
C: compilation errors
R: expression result (if any)
S: exception stack trace (if any)
O: Output from evaluation to System.out or System.err
E: Side-effects on REPL state (assigned to temporary, invalidated X, revalidated Y, class/method was declared/redeclared)
C is mutually exclusive with everything else.
R and S are mutually exclusive with each other.
Class/method declarations have no R, S, or O -- just E.
Some categories of E are more interesting than others, and therefore different verbosity levels may include some but not others.
I think the "Expression value is: " is just too wordy. No other REPL tested uses any english, they either just spit out the answer ("3"), or maybe with some punctuation ("=> 3"), or with some name and type information ("res1: Int = 3").
I'd like also to make any E output distinctive; I propose putting that in parentheses. More specifically, I propose putting O first, then R or S, then E.
Some examples of a proposed default scheme:
jshell> 1 + 1
=> 2 // R
(assigned to temporary $1 of type int) // E
jshell> System.out.println("Hi There")
Hi There // O
jshell> void m() { }
(defined method m())
jshell> /drop m
(dropped method m())
jshell> class C { }
(created class C)
jshell> int x = 3
(declared variable x of type int)
jshell> x = 4
(NO OUTPUT)
C/R/E/O would be visible in all feedback levels other than "off". Higher levels could introduce more wordiness in R, set off markers around O (such as [STDOUT] at beginning of line or begin/end markers), and turn on more E events.
Alternately, we could move feedback for declarations into category R, which is more like LISP REPLs:
jshell> class C { }
=> C
-Brian
R: expression result (if any)
S: exception stack trace (if any)
O: Output from evaluation to System.out or System.err
E: Side-effects on REPL state (assigned to temporary, invalidated X, revalidated Y, class/method was declared/redeclared)
C is mutually exclusive with everything else.
R and S are mutually exclusive with each other.
Class/method declarations have no R, S, or O -- just E.
Some categories of E are more interesting than others, and therefore different verbosity levels may include some but not others.
I think the "Expression value is: " is just too wordy. No other REPL tested uses any english, they either just spit out the answer ("3"), or maybe with some punctuation ("=> 3"), or with some name and type information ("res1: Int = 3").
I'd like also to make any E output distinctive; I propose putting that in parentheses. More specifically, I propose putting O first, then R or S, then E.
Some examples of a proposed default scheme:
jshell> 1 + 1
=> 2 // R
(assigned to temporary $1 of type int) // E
jshell> System.out.println("Hi There")
Hi There // O
jshell> void m() { }
(defined method m())
jshell> /drop m
(dropped method m())
jshell> class C { }
(created class C)
jshell> int x = 3
(declared variable x of type int)
jshell> x = 4
(NO OUTPUT)
C/R/E/O would be visible in all feedback levels other than "off". Higher levels could introduce more wordiness in R, set off markers around O (such as [STDOUT] at beginning of line or begin/end markers), and turn on more E events.
Alternately, we could move feedback for declarations into category R, which is more like LISP REPLs:
jshell> class C { }
=> C
-Brian
- blocks
-
JDK-8151754 jshell tool: add command line options for setting feedback mode
-
- Closed
-
- relates to
-
JDK-8148316 jshell tool: Configurable output format
-
- Closed
-