RFR: 8309235: Unnamed Variables (_) can't be used in JShell [v3]

Aggelos Biboudis abimpoudis at openjdk.org
Thu Jun 8 07:26:16 UTC 2023


> This PR addresses the issue of JShell not accepting unnamed local variables. This solution prints all local variables via the `/vars` command. e.g.,
> 
> 
> jshell> int _ = 42;
>  ==> 42
> 
> jshell> int _ = 43;
>  ==> 43
> 
> jshell> String _ = "44";
>  ==> "44"
> 
> jshell> /vars
> |    int _ = 42
> |    int _ = 43
> |    String _ = "44"

Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:

  Update src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
  
  Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/14337/files
  - new: https://git.openjdk.org/jdk/pull/14337/files/953b5846..970a7635

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=14337&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=14337&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/14337.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14337/head:pull/14337

PR: https://git.openjdk.org/jdk/pull/14337


More information about the kulla-dev mailing list