octave-maintainers
[Top][All Lists]
Advanced

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

Re: Special handling for "help" involving apostrophe?


From: John W. Eaton
Subject: Re: Special handling for "help" involving apostrophe?
Date: Fri, 21 Jul 2017 13:44:40 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/21/2017 04:33 AM, Daniel J Sebald wrote:
Just curious if anyone is interested in altering the interpretation of the "help" so that instead of

octave:22> help '
parse error:

   syntax error

help '
          ^

the result would be the same as from

octave:22> help "'"

  -- '
      Matrix transpose operator.  For complex matrices, computes the
[snip]
      See also: .', transpose.

I don't think that is breaking anything by handling in a special way, and it makes it a little bit more convenient for someone who is searching for help on that operator.

In a similar fashion, if the user is interested in the help for .' listed above, I doubt there is any use for this:

octave:23> help .'
ans =





F
o
r

h
e
l
p
[snip]

so I wonder if that help syntax interpretation could be altered as well.

There is no special "help syntax". It's just a function like any other that can be called with the command syntax. The symbol "help" may also be a user-defined function or a variable, so you can't just do something different if the first word in the statement is 'help'. And since this syntax can occur in a function, I don't see how you can do context-dependent parsing when the statement must be analyzed before even knowing whether the symbol "help" will refer to the built-in help function or something else on the load path. And doing something different at the top-level command prompt from what happens in other contexts seems really bad to me.

But if someone sees a way to make this work that is not overly complicated and wants to propose a patch that doesn't break other things, then OK, we can review it. I just don't think there is a simple solution.

jwe



reply via email to

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