This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Function syntax (Was: [RFC][patch 1/9] initial Python support)
- From: "Doug Evans" <dje at google dot com>
- To: tromey at redhat dot com
- Cc: "Thiago Jung Bauermann" <bauerman at br dot ibm dot com>, gdb-patches at sourceware dot org
- Date: Sun, 8 Jun 2008 08:24:12 -0700
- Subject: Re: Function syntax (Was: [RFC][patch 1/9] initial Python support)
- References: <20080429155212.444237503@br.ibm.com> <20080429155304.288626880@br.ibm.com> <20080528205921.GA2969@caradoc.them.org> <m31w3ketw3.fsf_-_@fleche.redhat.com>
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]