JShell /-n command

Michael Müller michael.mueller at mueller-bruehl.de
Wed Oct 19 13:45:49 UTC 2016


Hi,


Is this feature removed [ :( ] or will it be kept [ :-) ]?


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 10/13/2016 07:04 PM, Brian Goetz wrote:
> This is derived from a feature from Unix shells, which I use all the 
> time; frequently you have a sequence of "do this, then do that, then 
> do the other thing", and doing "-n" repeatedly handles that sequence.  
> Easier than "hit up arrow five times, return, repeat".
>
> On 10/12/2016 5:15 PM, Robert Field wrote:
>> I agree this isn't useful and is confusing -- for another reason too 
>> -- from /help:
>>
>> | /<id> -- re-run snippet by id
>> | /-<n> -- re-run n-th previous snippet
>>
>> So /3 refers to a snippet-id and /-3 refers to a count backwards.
>>
>> I've never used the /-n form.  For one, the up-arrow is much more 
>> convenient.
>>
>> Unless I hear an strong advocate, I will remove.
>>
>> Thanks,
>> Robert
>>
>> On 10/12/16 09:55, Paul Deitel wrote:
>>> Is the command
>>>
>>>     /-n
>>>
>>> actually useful? Chances are, if you have any decent number of 
>>> snippets, you will not recall more than the last few you typed.
>>>
>>> You can already execute the last valid snippet with /!.
>>>
>>> For anything else, you’d probably have to do a /list to see what 
>>> valid snippets you have. At that point, rather than doing /-n, you’d 
>>> just use /<id> to execute a given snippet.
>>>
>>> One point of emphasis in many JShell presentation has been how it’s 
>>> useful for beginners. I’ve been teaching beginning programmers for 
>>> 25+ years. A beginner seeing options like this will only get confused.
>>>
>>> I recommend removing /-n as an option.
>>>
>>> Paul
>>>
>>> Paul J. Deitel, CEO
>>> Deitel & Associates, Inc.
>>> Oracle Java Champion
>>> Microsoft Visual C# MVP 2012-2014
>>>
>>> http://www.deitel.com
>>> 978-443-2423
>>>
>>> Facebook: http://facebook.com/DeitelFan
>>> Twitter: @deitel
>>> LinkedIn: http://www.linkedin.com/company/deitel-&-associates
>>> YouTube: http://youtube.com/DeitelTV
>>> Instagram: http://instagram.com/DeitelFan
>>> Google+: http://google.com/+DeitelFan
>>>
>>> Newsletter: http://www.deitel.com/newsletter/subscribe.html
>>>
>>> On-Site Worldwide Corporate Training: http://www.deitel.com/training/
>>> Purchase our most recent books: http://amzn.to/18BLG2I
>>> Resource Centers: http://www.deitel.com/ResourceCenters.html
>>>
>>>
>>>
>>>
>>
>
>



More information about the kulla-dev mailing list