JShell /-n command
Michael Müller
michael.mueller at mueller-bruehl.de
Thu Oct 13 17:45:14 UTC 2016
+1
--
Herzliche Grüße, Best regards
Michael Müller
Twitter: @muellermi
Blog: blog.mueller-bruehl.de
Web Development with Java and JSF: leanpub.com/jsf
Java Lambdas and Parallel Streams: leanpub.com/lambdas
Am 13. Oktober 2016 19:04:08 MESZ, schrieb Brian Goetz <brian.goetz at oracle.com>:
>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