This is the mail archive of the
mailing list for the Archer project.
Re: pretty-printing update
Tom Tromey wrote:
>>>>>> "AndrÃ" == AndrÃ PÃnitz <email@example.com> writes:
> AndrÃ> For a "machine" interface, something more structured (and more
> AndrÃ> robust to parse) would be needed anyway.
> We talked about this at the meeting.
> In my email I didn't mention it, but there is already code on the
> python branch to handle pretty-printing for MI. This code works in a
> somewhat different way than the CLI pretty-printing I've implemented.
> One thing on my to-do list is to look at unifying the two. It would
> be nice for library authors (e.g.) to be able to write a single class
> for printing a type and have it work in all cases.
I think the most fundamental difference between your approach and
MI one is that for MI, there's class with one method to return
string rendition, and another method to return children values.
Returning children values, as opposed to some string names, is
very desirable for MI. OTOH, there's no support to specify names
for children, they are just numbered. Also, for std::map, you
probably would want to return pairs of values and GUI should understand
that mapping is been displayed, I don't know how to communicate this.
Note also in MI, each variable object is associated with an instance
of a class, so it can keep some state. I was also thinking that the
method returning children should actually return an interator
(use yield), so that incremental fetch of children is possible.