This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [python] A case for "mixed" pretty-printers
- From: Tom Tromey <tromey at redhat dot com>
- To: ppluzhnikov at google dot com (Paul Pluzhnikov)
- Cc: archer at sourceware dot org
- Date: Mon, 10 Nov 2008 13:11:18 -0700
- Subject: Re: [python] A case for "mixed" pretty-printers
- References: <20081110181740.633843A6B11@localhost>
- Reply-to: Tom Tromey <tromey at redhat dot com>
Paul> const char *to_string () const; // Pretty printer
Paul> Imagine that the internal state of Foo is somewhat complicated,
Paul> and that to_string() method takes significant C++ code to implement
Paul> (not something easily re-coded in Python) and already exists.
Paul> But what I really want is a mixture, in which Python pretty
Paul> printer calls the application one [1]:
Paul> How difficult would this be to achieve?
As long as the application printer constructs some kind of
stringlike-object (as opposed to printing directly to stdout or
something), it is not hard. I think all that is required is to
implement inferior function calls via Value.
Tom