Re: [PATCH v4 1/3] Add support for structured output formatters.

Subject: Re: [PATCH v4 1/3] Add support for structured output formatters.

Date: Thu, 12 Jul 2012 13:22:12 +0200

To: Mark Walters, notmuch@notmuchmail.org

Cc:

From: craven@gmx.net


> what is the advantage of having this as one function rather than end_map
> and end_list? Indeed, my choice (but I think most other people would
> disagree) would be to have both functions but still keep state as this
> currently does and then throw an error if the code closes the wrong
> thing.

There's probably no advantage, one way or the other is fine, I'd say.
I've thought about introducing checks into the formatter functions, to
raise errors for improper closing, map_key not inside a map and things
like that, I just wasn't sure that would be acceptable.

> A second question: do you have an implementation in this style for
> s-expressions. I find it hard to tell whether the interface is right
> with just a single example. Even a completely hacky not ready for review
> example would be helpful.

See the attached patch :)

Thanks for the suggestions!

Peter

Thread: