Re: Function syntax (Was: [RFC][patch 1/9] initial Python support)

Doug Evans
2008-06-08T15:24:35Z

On Thu, May 29, 2008 at 1:29 PM, Tom Tromey <tromey@redhat.com> wrote:
> I suppose my basic proposal is that all functions be derived from
> something like:
>
> class Function:
> # ARG is a string, already de-quoted and whitespace-stripped.
> def invoke(self, arg):
> do something
>
> def complete(self, text, word):
> complete the argument
>
> This is basically exactly what we do for commands, only in the
> Function case we could expect invoke to return a value.

IWBN if this also included some help text that was somehow hooked into
help/apropos. [maybe as fhelp, fapropos, or some such]