|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] Re: [RFC 0/7] QError v1 |
Date: | Fri, 30 Oct 2009 19:10:55 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4 |
On 10/30/2009 07:09 PM, Jamie Lokier wrote:
Anthony Liguori wrote:Jamie Lokier wrote:Anthony Liguori wrote:Okay, let's get more clever then and do: #define QERR_DEV_NFOUND "{ 'code': 404, 'name': %s}"By the way, since you've already invented a non-standard JSON extension, which is the single quotes, why not go a step further and permit the quotes to be omitted for simple tokens? #define QERR_DEV_NFOUND "{ code: 404, name: %s}" Much neater, IMHO.Javascript has keywords (like true, false, and null) that could lead to confusion using such a syntax.I was thinking only before the colon in a dictionary. Are the keywords a problem in those positions, for Qemu?
Maybe no, but that would complicate the parser uselessly. I don't think two apostrophes are a huge problem, since 'code' is already a bigger improvement over \"code\".
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |