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.0 (2014-02-07) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.0
Message-ID: <56A6F01E.8030306@inlv.org>
Date: Tue, 26 Jan 2016 04:03:42 +0000
From: Martijn Dekker <martijn@inlv.org>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
MIME-Version: 1.0
To: zsh-workers@zsh.org
CC: Bart Schaefer <schaefer@brasslantern.com>
Subject: Re: [BUG] quoting within bracket patterns has no effect
References: <569C68AB.2010806@inlv.org> 	<20160118172434.2fb7d5b9@pwslap01u.europe.root.pri> 	<56A2C6A8.4090108@inlv.org> <160122174949.ZM11794@torch.brasslantern.com>
In-Reply-To: <160122174949.ZM11794@torch.brasslantern.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Seq: zsh-workers 37783

Bart Schaefer schreef op 23-01-16 om 01:49:
> This is related to long-standing behavior for zsh in native mode.
> 
> In as-close-as-zsh-has-to-POSIX mode:

(Which, by the way, is very close now.)

> In native mode you need to use $~param to activate pattern characters
> in the expanded value:
> 
> schaefer[656] Src/zsh -f
> torch% myrange='a-z'
> torch% somevar='c'
> torch% case $somevar in
> case> ( *[$~myrange]* )  echo "$somevar is part of $myrange" ;;
> case> esac
> c is part of a-z
> torch% 
> 
> 
> It's true that needing this inside a character class now differs from
> previous versions of zsh for native mode.  I'm not sure it's possible
> to have it both ways.

In normal variable expansion, setting the option SH_WORD_SPLIT causes
unquoted $var to be equivalent to ${~var} in variable expansion.
Wouldn't it make sense to have SH_WORD_SPLIT activate pattern characters
in unquoted variables in range expressions as well? This would make zsh
under 'emulate sh' exactly compatible with bash, (d)ash, {pd,m}ksh and yash.

- Martijn

