JShell: representation of array values

Michael Müller michael.mueller at mueller-bruehl.de
Thu Sep 22 17:09:19 UTC 2016


Hi Robert, Beside my quick "Great" some additional thoughts:

For large arrays this kind of output will extremely divide the inputs. 
Sometimes I like to keep all of my input together.

For mitigation, /list can be used.

I propose an additional output window, e.g.

/output window

opens a second window. All output is redirected to that window

/output self

resets the output channel to the shell's own window.


The extra output window might be the same like the editor (which is used 
as default for /edit), but readonly. This allows the user to mark and 
copy parts of the output.



Herzliche Grüße - Best Regards,

Michael Müller
Brühl, Germany
blog.mueller-bruehl.de <http://blog.mueller-bruehl.de/>
it-rezension.de <http://it-rezension.de/>
@muellermi


Read my books
"Web Development with Java and JSF": https://leanpub.com/jsf
"Java Lambdas und (parallel) Streams" Deutsche Ausgabe: 
https://leanpub.com/lambdas-de
"Java Lambdas and (parallel) Streams" English edition: 
https://leanpub.com/lambdas

On 09/22/2016 03:16 AM, Robert Field wrote:
> JavaOne demos made it clear we need a friendlier representation of 
> array values.
>
> Current --
>
> jshell> new String[] { "hi", "low", null }
> $2 ==> [Ljava.lang.String;@ae45eb6
>
> jshell> new char[] { 'a', 34, 77 }
> $3 ==> [C at 27efef64
>
> I'm proposing this --
>
> jshell> new int[4]
> $1 ==> int[4] { 0, 0, 0, 0 }
>
> jshell> new int[0]
> $2 ==> int[0] {  }
>
> jshell> new String[] { "hi", "low", null }
> $3 ==> String[3] { "hi", "low", null }
>
> jshell> new char[] { 'a', 34, 77 }
> $4 ==> char[3] { 'a', '"', 'M' }
>
> jshell> new int[][] { new int[] {44, 55}, new int[] {88,99}}
> $5 ==> int[][2] { int[2] { 44, 55 }, int[2] { 88, 99 } }
>
> jshell> new Object[] { "howdy", new int[] { 33, 44, 55 }, new String[] 
> { "up", "down" }}
> $6 ==> Object[3] { "howdy", int[3] { 33, 44, 55 }, String[2] { "up", 
> "down" } }
>
> jshell> new int[100000]
> $7 ==> int[100000] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
>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