help-octave
[Top][All Lists]
Advanced

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

Re: How to get docstring of a function ?


From: Søren Hauberg
Subject: Re: How to get docstring of a function ?
Date: Tue, 11 May 2010 09:14:52 -0700

tir, 11 05 2010 kl. 08:34 -0500, skrev Jordi Gutiérrez Hermoso:
> On 11 May 2010 07:52, Ben Abbott <address@hidden> wrote:
> > On Monday, May 10, 2010, at 01:17PM, "Pablo Winant" <address@hidden> wrote:
> 
> >>This works in Matlab, but in octave it triggers an interactive viewer
> >>which I don't want (I try to control Octave remotely).
> [snip]
> >    help get_help_text_from_file
> 
> In case the Matlab-compatible behaviour or similar is desired,
> attached is a proposal.
> 
> This was too easy, which makes me think it's probably wrong in ways I
> haven't foreseen. ;-)

Looking at your patch (I haven't tried it), I get the impression that

  a = help ("some_function");

will return the docstring, but also display it. Shouldn't it more be
something like

  if (nargout > 0)
    docstring = text;
  else
    display (text);
  endif

? Other than that, then I would indeed expect the change to be as
trivial as what you suggest.

Søren



reply via email to

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