From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18835 invoked by alias); 13 Dec 2010 17:35:34 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28527 Received: (qmail 14688 invoked from network); 13 Dec 2010 17:35:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <101213093514.ZM10971@torch.brasslantern.com> Date: Mon, 13 Dec 2010 09:35:12 -0800 In-reply-to: <20101213094746.35712a38@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: Another ${(z)param} buglet" (Dec 13, 9:47am) References: <101207203441.ZM4340@torch.brasslantern.com> <20101208175103.40d6cc29@pwslap01u.europe.root.pri> <101209074233.ZM8003@torch.brasslantern.com> <20101209181632.27d47e95@pwslap01u.europe.root.pri> <20101209201913.43a94f54@pws-pc.ntlworld.com> <20101212224523.423399db@pws-pc.ntlworld.com> <101212172652.ZM9617@torch.brasslantern.com> <20101213094746.35712a38@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Subject: Re: Another ${(z)param} buglet MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 13, 9:47am, Peter Stephenson wrote: } } Bart Schaefer wrote: } > What say? This could also easily be tweaked to make (z) and (z:...:), } > with the :...: having become optional It occurred to me later that, because any character can be a delimiter, it's not really possible to have it be optional in this way. That is, ${(lq8qq-q)RANDOM} only works because "l" is always followed by a delimiter. } If you've got Z you don't necessarily need z+ as well. I was trying to } avoid using up yet another letter, but once you do there's no great } need to do anything with the original one. OK ... that still doesn't answer the question of whether to in fact use up that extra letter, which is probably related to the question of whether one ever might want to use a different delimiter. As it's already possible to write confusing-looking expansions like that RANDOM example, how about this suggestion: Let's go ahead and use up Z for this so as not to tangle up z with a new more restricted delimiter syntax. Further let's immediately reserve a character (maybe "+") to have no meaning of its own, but instead to always introduce a delimited string into which we can put new options. E.g. (C) and (+(C)) could have distinct meanings. That gets us back the entire alphabet for new things we want to throw into (+:...:), and permits the possibility of nesting (which I hope we'd never need) such as (+{+{...}}). Currently (before z+ or the above proposal) we have these letters left over (I'm intentionally excluding $ as that would engender _way_ too much confusion): ^ = _ * + b g G J K T x y Y Z In the "probably to be avoided" category are: < > | - , ; : ! ? / . [ ] { } & And we've used these: ~ @ # % 0 a A B c C d D e E f F i I j k l L m M n N o O p P q Q r R s S t u U v V w W X z Thoughts? I'd actually lean towards "_" rather than "+" as the introducer for the delimted extension syntax, but there may be things I'm not considering like limitations of non-English keyboards. --