Re: Special handling for "help" involving apostrophe?
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
> 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 =
> 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