cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: julia.lawall@lip6.fr (Julia Lawall)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Compacting parameters into fewer lines
Date: Wed, 1 Aug 2018 08:17:46 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1808010813480.2753@hadrien> (raw)
In-Reply-To: <d7969956-e440-3dad-4d88-da39b8809148@users.sourceforge.net>

> How do you think about to improve the replacement specification a bit more
> by combining the variants A  till D into a single SmPL rule which will use
> a nested SmPL disjunction?

I haven't actually looked at the semantic patch code, but I would point out
that making a disjunction is not always a good idea.  The semantics of a
disjunction is that if an earlier pattern matches, then the later patterns
are not considered.  The semantics of a succession of rules is that later
patterns are applied to the result of earlier patterns.  These are clearly
not the same things.  At the expression level, ensuring that subsequent
patterns don't apply if earlier ones do entails quite a lot of work, so a
disjunction may not be very efficient.  This performance issue is much less
at the statement level.

If there are no semantics or performance issues involved, then I would be
inclined to think that the way the person first decided to write the rule is
the best way, because that is how they thought about the problem.

julia

  reply	other threads:[~2018-08-01  6:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 14:27 [Cocci] Compacting parameters into fewer lines Timur Tabi
2018-07-31 14:33 ` Julia Lawall
2018-07-31 15:03   ` Timur Tabi
2018-07-31 15:18     ` Julia Lawall
2018-07-31 15:34       ` Timur Tabi
2018-07-31 16:12     ` SF Markus Elfring
2018-07-31 19:48       ` Timur Tabi
2018-08-01  6:08         ` SF Markus Elfring
2018-08-01  6:17           ` Julia Lawall [this message]
2018-08-02 20:32           ` Timur Tabi
2018-07-31 19:21     ` Julia Lawall

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=alpine.DEB.2.20.1808010813480.2753@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).