Closed asm0dey closed 4 years ago
The default Kotlin REPL behaviour is to define the result field named resN
(where N
is the line number) for every "expression-line" so in your first example it would be res4
.
Completion doesn't work for these fields though, but this is a different issue.
I also added rendering of the resX fields, so it should be now obvious how to use them.
Whe we use language-CLIs like ipython we know that when we call some expression without assigning it to variable implicit variable is being created like this:
Here we call output of
In [4]
byOut[4]
.Same effect in jshell:
jshell generates unnamed variables.
I believe the same thing should be supported in
kotlin-interactive-shell