From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10017 invoked by alias); 5 Mar 2015 10:06:47 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19973 Received: (qmail 677 invoked from network); 5 Mar 2015 10:06:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f4-b7f126d000001e9a-e9-54f82a1f7478 Date: Thu, 05 Mar 2015 10:06:38 +0000 From: Peter Stephenson To: zsh-users@zsh.org Subject: Re: grammar triviality with '&&' Message-id: <20150305100638.55631238@pwslap01u.europe.root.pri> In-reply-to: <150304175112.ZM19818@torch.brasslantern.com> References: <54F33934.2070607@eastlink.ca> <13666281425228233@web7o.yandex.ru> <54F345D3.9010204@eastlink.ca> <20150302022754.GA7449@xvii.vinc17.org> <20150302104619.GC6869@xvii.vinc17.org> <20150302110610.2e2c7e86@pwslap01u.europe.root.pri> <20150304144756.GA27231@ypig.lip.ens-lyon.fr> <150304175112.ZM19818@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOLMWRmVeSWpSXmKPExsVy+t/xq7ryWj9CDBaflLLYcXIlowOjx6qD H5gCGKO4bFJSczLLUov07RK4Mu48/c1a0MFesfT4XcYGxsOsXYycHBICJhL/Gm6zQ9hiEhfu rWfrYuTiEBJYyijRu+EgK4SziEni6Jvf7BDONkaJnROPsYC0sAioSszafI0JxGYTMJSYumk2 I4gtIiAqsXzFZrCxwgKaEss+fGYDsXkF7CV6u9eD2ZwCVhKTDjVDbZjFItG96yjYUH4BfYmr fz8xQdxkLzHzyhlGiGZBiR+T74HVMAtoSWze1sQKYctLbF7zlhnEFhJQl7hxdzf7BEahWUha ZiFpmYWkZQEj8ypG0dTS5ILipPRcQ73ixNzi0rx0veT83E2MkMD9soNx8TGrQ4wCHIxKPLwF Sd9ChFgTy4orcw8xSnAwK4nwMin+CBHiTUmsrEotyo8vKs1JLT7EyMTBKdXA2Db5bGLYuqoj bXxuU9qfbuw9uaNNTvtmIt+HCj4uIad3kRcLNEV+5s/ZfOLJPW2+9V8fTf/40G7P9/e8WwJF 1V50T1/RM1EoO+qBeMySueb6PI21pUFPH63IrjLJ9Kz7uvbT7Bnn3qTXLkp4OXGLu6Tvf7Ge dT/YFm/2KoxR+zRJ8/o3k98HzyqxFGckGmoxFxUnAgBVEmMOOgIAAA== On Wed, 4 Mar 2015 17:51:12 -0800 Bart Schaefer wrote: > On Mar 4, 3:47pm, Vincent Lefevre wrote: > } > } I've found a bug: > } > } % alias '&&=(){ return $? } && ' > } % && echo OK > } zsh: parse error near `&&' > > Although I see PWS has already made a (broken?) stab at changing this, > I think that's a documentation omission rather than a code bug. Some > things intentionally cannot be aliased. I don't think that makes sense: there's too much you already can alias. You can alias reserved words and arbitrary magic sequences like \&, for example, and consequently already have the power to do as much damage as you like. Forbidding it in this case would just be providing an unmemorable list of special cases. I suspect this dates back to very early days when the shell was much weaker on translating lexical tokens back to to text. pws