Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :cc;
        bh=rjbSL7fVhqcxR1KUgHRE33sHD9NzYnU06NLDN1IaevQ=;
        b=BfPxdUZrmZAQDPnEJC9aoBj9KTq2Zvbe+VhoTLHUBTSQ1eDmKmc4iTmEeL2ot3yjMy
         siHRMqjMNElyse1J5WViud57HEfQ8HnbJW1fHDtUp5FQ/unVvE612y+1ZKlb4qk/xTmr
         MRyqBzKjszwWfbW2caU25ddAzOSGddquCHL5nAkiEw2uGjegzJlZamQTv5JYjlyY3dlz
         8reOmquizDCSxZKCQDN2veza6x1wWo1U4VKjtVc389vi5/Hsgs/z5CiWogMQ58Y0/LNH
         QtVoJsbmTNf0GSXF5RKyd/b7TsQmao9q9YKFNWuYRuHeCGuPKu9W9B966+9mOaS1ta4u
         imNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:cc;
        bh=rjbSL7fVhqcxR1KUgHRE33sHD9NzYnU06NLDN1IaevQ=;
        b=AIyu/fb7XlVhyC8PrQie3VZdyeDUt0p0b+SIDx7a6cA9E0ARV/isQ0OQjcXV6J8zYU
         6ilVSUAgT7ic0gZnAqDLYlKhX46L10NBzMoPTXyQUeSu3SUaZovWGUB4RoJ3z2yQrkf/
         /JMAen7FPhCF6pQqh6nTMCgmLLqq9MAICTKdF92WFiUmlrr9Zx9r7SwAXFIRpqhJ452V
         fylDUFg7nTcziZx0zFajWsUT+jDPSuekRiEkire7hO9NUw4p02s6v9eyOYWCBlRxO48U
         EVR1zSdjZaMdjUdm3IzZ5Z1wD44arhlIMCudTJUsPnp5C7QCxreDrxfgB4GzKfa23bAS
         ET9A==
X-Gm-Message-State: AD7BkJIF17Jgi8d/ycWFvOxH768Jknm2yb85CrXd07d1xSm37YbVf/GA14nU0XH67ANr1YwRZrxilyTHIBKkLw==
MIME-Version: 1.0
X-Received: by 10.55.178.198 with SMTP id b189mr22017250qkf.98.1460376370619;
 Mon, 11 Apr 2016 05:06:10 -0700 (PDT)
In-Reply-To: <20160411120716.06a6d1c9@pwslap01u.europe.root.pri>
References: <CAHYJk3TY5kU0fXDkk2iO7kRJhhMTS1f4a9Am1ueN4wCXOQ7Hsg@mail.gmail.com>
	<160410151105.ZM21544@torch.brasslantern.com>
	<20160411093738.11406966@pwslap01u.europe.root.pri>
	<CAHYJk3SEeghkbpLCE26bG_76nM5PYp9MF68AO1ue00DHTwRV6A@mail.gmail.com>
	<20160411112941.579d8157@pwslap01u.europe.root.pri>
	<CAHYJk3QkC_jDq94ax2vMZUCaU2iELFO7kk49ogQUg-qafDtgPA@mail.gmail.com>
	<20160411120716.06a6d1c9@pwslap01u.europe.root.pri>
Date: Mon, 11 Apr 2016 14:06:10 +0200
Message-ID: <CAHYJk3Qc8WsRAxav6wT8MmoEKj-hDByAA3ZCWHHbTt=+CaUQxQ@mail.gmail.com>
Subject: Re: Allow slash in alternation patterns in limited cases?
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh workers <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 38273

On Mon, Apr 11, 2016 at 1:07 PM, Peter Stephenson
<p.stephenson@samsung.com> wrote:
> On Mon, 11 Apr 2016 12:47:21 +0200
> Mikael Magnusson <mikachu@gmail.com> wrote:
>> Maybe I misunderstood your original point. I thought you meant making
>> (foo/bar|baz/bong) work in a glob would make it more incompatible with
>> pattern matching, but it already works there.
>
> The point is that, unlike the ~ case which is just a flag passed in to
> the pattern match parser, it would longer done by pattern matching at
> all.  It would be done in the glob code.  The pattern match code would
> see the foo, bar, baz, bong, and it would it be reassembled higher up.
> So it's not so much incompatible as something utterly different.

This is already the same difference we have between (foo|bar) in
globbing and pattern matching though. If it's a glob, it's handled
recursively by scanner() and if it's pattern, it's somewhere else (I
don't even know where the general pattern matching code is by heart).
Maybe this is just exactly what you're saying, and I read some
objection where there was just a statement about how things are. I
don't see how any additional inconsistensies with the pattern matching
code arises from the end-users's perspective though (see separate
patch). Well, things like (#i) don't carry across from one pattern to
the next... I suppose that's somewhat major.

-- 
Mikael Magnusson

