UI review: jshell commands
Brian Goetz
brian.goetz at oracle.com
Tue Jun 30 00:02:29 UTC 2015
Now that you have whacked us over the head with "hey, you guys are
looking in the wrong direction", I tend to agree. In fact, that the
elements of /list show up starting with 9 is also weird.
So, how about reflecting this more directly; have the "startup IDs"
start at something like auto.1 or startup.1, and then flip over to 1
when we finish with startup. Then /list would start with 1; /list all
would look like:
auto.1: import ...
auto.2: import
1: 1 + 1
The only important reason that we even need an ID for the startup
entries is so we can /drop it. Having an ID of the form "auto.1" works
fine for that. There's no reason ID has to be an int, is there?
> Otherwise, the intermediate results of the startup file should be
> dropped. Or at least they should not interfere with the auto-generated
> names for interactive results.
>
> Two compromises possible on that:
>
> 1. If for some reason we must, auto-generate a different set of names
> for the startup file, starting with $_ (think, "negative") or $0:
>
> 1+1;
> $1 = 2;
> $_1; // host id from startup, etc.
>
> 2. If you buy my argument that auto-generated things are usually
> useless, have an opt-in argument for those special times when you need
> auto-numbering of the file. Replaying a previous interactive input is
> really a different use case from reusing a common profile.
>
> Such a special time would be replaying scripts, but I can't think of any
> other. Perhaps that is envisioned as the default. In that case, we
> should be sure that it in the *other default*, when pulling from a
> startup file like ~/.kullarc, it should be easy to suppress the creation
> of $N variables.
>
> — John
More information about the kulla-dev
mailing list