octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modifications to error handling for the command suggestion feature


From: Sudeepam Pandey
Subject: Re: Modifications to error handling for the command suggestion feature
Date: Sun, 20 May 2018 02:34:24 +0530



On Sun, May 20, 2018 at 12:16 AM, Nicholas Jankowski <address@hidden> wrote:


On Sat, May 19, 2018, 14:02 Sudeepam Pandey <address@hidden> wrote:
All,

I'm starting to guess that adding a command suggestion feature would require some changes to the error handling.

...

Could anyone help me understand how that call could be made or maybe, help me figure out a better way to make octave first print out the 'undefined near line' error message and then tell us something about the identifier which parser did not recognize? (perhaps some better place to make the call from?)

Not any help on the code, but I'm trying to think through the under-the-hood decision tree. 

1. Unrecognized function call
2. Check for unloaded possible package function - if so suggest installing/ loading.
3. If not prompt for to-be-implemented suggestions. Since its just text display this can include a version of the error message.
4. Else: error with explanation.

I think you need to leave some error condition as a final fallback to terminate execution. I don't know if you can call the the error message early before terminating execution. Maybe that's what you're suggesting?

Yes I was suggesting the exact thing. Can we somehow...generate the error message first and then do a certain thing (such as suggesting possible unloaded package/ unimplemented function etc). Also, I agree with you. An error condition to terminate execution is more suitable. However to use the menu (or similar) function to give a prompt to the user to select and execute the options suggested would require us to make changes to the error handling. If we make the command line suggestion feature in such a way that it does not give the user an option to select the commands suggested no changes to the error handle would be required.

A little thinking gave me another possible idea. Why use the menu or any other function to provide an easy way to select and execute the commands? We simply display the suggestions and the user can just press the upward arrow key, make the small change to the command (note that the change would be small since the word would be a close match) and execute it. Isn't that simple too?



This brings up another thought: if I make a typo in a script, do I want command suggestion to occur? I don't think so. If we mess with general error handling, can that be aware of whether the typo happened at the CLI?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]