JShell tool feedback modes -- predefined and default

Robert Field robert.field at oracle.com
Sat Mar 12 02:31:38 UTC 2016


That is exactly the kind of information I'd love to get from real-world 
use.  Is knowing the value of assignments and initializations frequently 
useful or usually noise?
I encourage all to use one of these as your default mode.

Thanks,
Robert

On 03/11/16 16:45, Brian Goetz wrote:
> For declaration with initialization:
>
> jshell> int a =3
> a ==> 3
>
> and for assignment:
>
> jshell> a = 3
> a ==> 3
>
> I would drop the {result} feedback for this form (in default and 
> concise).  A declaration with initialization, or assignment, should be 
> like any other statement (if, for, while) and these do not produce 
> output.  If the user does
>
> jshell> a = 3
>
> and wants to see the value of a, s/he can always ask by evaluating 'a'.
>
>
> On 3/11/2016 7:09 PM, Robert Field wrote:
>> [hmmm..., For some reason kulla-dev seems to have removed all the 
>> text from my message.  Trying again using a link rather than an 
>> attachment...]
>>
>> I recently added an output configuration mechanism to the jshell 
>> tool, allowing users to specify how they would like feedback from the 
>> tool to look.  And, importantly, allowing us to experiment with what 
>> we want the default mode to look like.
>>
>> Using this, Brian and I have been discussing what we want.  Some of 
>> the conclusions are:
>>
>>     * Some of the output is essential and should be highlighted and 
>> always displayed:  results and errors  (and possible temp var name)
>>     * Some of the output is informative but can be garnered in other 
>> ways: type
>>     * Some of the output is confirmation, which is reassuring to new 
>> users and annoying to frequent users
>>     * We decided that it would help making design choices (and give 
>> easy options to users) if there were three predefined levels of 
>> output: verbose, concise, and default
>>     * If we can come up with a consistent layout for concise and 
>> verbose, the more challenging choice of layout for default would be a 
>> matter of picking between the two.
>>     * result is essential and needs a special form.
>>     * Other information is optional and would not show in more 
>> concise modes
>>     * temp variables are generated for expressions to allow access to 
>> these values, without displaying what the temp variable name it is of 
>> little use, thus this name cannot be displayed only in the optional 
>> information
>>     * so, rather than create an asymmetry, the variable name should 
>> be displayed in the result
>>     * the length of the regular and continuation prompts must be the 
>> same, else indenting is confusing
>>     * there needs to be easy ways to set the mode (say by an 
>> instructor or and experienced user) so a command-line option is needed
>>     * /help should (in default mode) offer the /set feedback verbose
>>
>> Based on these discussions and some of our earlier prototypes, I have 
>> created the (version 0) feedback modes: verbose0, default0, and 
>> concise0 as progressive filters on the corresponding more verbose mode.
>>
>> Download:
>>     http://cr.openjdk.java.net/~rfield/proto.modes
>>
>> Starting with a current build of jdk9/dev,  start jshell and type:
>>     /open proto.modes
>>
>> It sets to default0, you can change this with:
>>    /set feedback verbose0
>> which you can abbreviate to:
>>    /se fe v
>>
>> What do you think?
>> What would you change?
>> New mode definitions welcome.
>>
>> Thanks,
>> Robert
>>
>



More information about the kulla-dev mailing list