From: "Benoît Canet" <benoit.canet@irqsave.net>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Benoît Canet" <benoit.canet@irqsave.net>,
vilanova@ac.upc.edu, qemu-devel@nongnu.org,
lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH] qapi: Make the include directive idempotent.
Date: Fri, 9 May 2014 16:55:31 +0200 [thread overview]
Message-ID: <20140509145530.GA19008@irqsave.net> (raw)
In-Reply-To: <87a9arbjj4.fsf@blackfin.pond.sub.org>
The Friday 09 May 2014 à 07:36:31 (+0200), Markus Armbruster wrote :
> Benoît Canet <benoit.canet@irqsave.net> writes:
>
> > The Thursday 08 May 2014 à 20:30:33 (+0200), Markus Armbruster wrote :
> [...]
> >> There are two reasons to detect cycles. The technical one is preventing
> >> infinite expansion. No longer applies with idempotent include. The
> >> other, more abstract one is rejecting nonsensical use of the include
> >> directive. I think that one still applies.
> [...]
> >> > @@ -102,17 +102,16 @@ class QAPISchema:
> >> > 'Expected a file name (string), got: %s'
> >> > % include)
> >> > include_path = os.path.join(self.input_dir, include)
> >> > - if any(include_path == elem[1]
> >> > - for elem in self.include_hist):
> >> > - raise QAPIExprError(expr_info, "Inclusion loop for %s"
> >> > - % include)
> >> > + # make include idempotent by skipping further includes
> >> > + if include_path in [x[1] for x in include_hist]:
> >> > + continue
> >>
> >> Loses cycle detection.
> >
> > It simply also skip cycle includes. If cycle are skipped then cannot do no
> > harm.
>
> Your argument is based exclusively on the technical reason to detect
> cycles: cycles need to be caught because they cause infinite recursion.
> Since there is no infinite recursion with idempotent include, cycles are
> just fine.
>
> I'm arguing from a more abstract point of view: cycles should be
> rejected because they're nonsensical. The fact that they can cause
> infinite recursion is an implementation detail. Even without infinite
> recursion, they're just as nonsensical as ever.
>
> [...]
>
Ok. will redo it.
prev parent reply other threads:[~2014-05-09 14:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 15:18 [Qemu-devel] [PATCH] qapi: Make the include directive idempotent Benoît Canet
2014-05-08 18:30 ` Markus Armbruster
2014-05-08 20:04 ` Benoît Canet
2014-05-09 5:36 ` Markus Armbruster
2014-05-09 14:55 ` Lluís Vilanova
2014-05-09 14:55 ` Benoît Canet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140509145530.GA19008@irqsave.net \
--to=benoit.canet@irqsave.net \
--cc=armbru@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vilanova@ac.upc.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.