From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26272 invoked from network); 19 Jan 2007 12:02:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Jan 2007 12:02:23 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 47236 invoked from network); 19 Jan 2007 12:02:13 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Jan 2007 12:02:13 -0000 Received: (qmail 19606 invoked by alias); 19 Jan 2007 12:02:05 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11135 Received: (qmail 19597 invoked from network); 19 Jan 2007 12:02:05 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 19 Jan 2007 12:02:05 -0000 Received: (qmail 46151 invoked from network); 19 Jan 2007 12:02:05 -0000 Received: from cluster-c.mailcontrol.com (168.143.177.190) by a.mx.sunsite.dk with SMTP; 19 Jan 2007 12:01:59 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly23c.srv.mailcontrol.com (MailControl) with ESMTP id l0JC1DUo011288 for ; Fri, 19 Jan 2007 12:01:56 GMT Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Fri, 19 Jan 2007 12:01:24 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.8/8.13.4) with ESMTP id l0JC1L9u003667 for ; Fri, 19 Jan 2007 12:01:21 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.13.8/8.13.8/Submit) with ESMTP id l0JC1KkO003663 for ; Fri, 19 Jan 2007 12:01:21 GMT Message-Id: <200701191201.l0JC1KkO003663@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-users@sunsite.dk Subject: Re: Case statement with ";|" [not implemented] In-reply-to: <070118205243.ZM30783@torch.brasslantern.com> References: <070118205243.ZM30783@torch.brasslantern.com> Comments: In-reply-to Bart Schaefer message dated "Thu, 18 Jan 2007 20:52:43 -0800." Date: Fri, 19 Jan 2007 12:01:20 +0000 From: Peter Stephenson X-OriginalArrivalTime: 19 Jan 2007 12:01:24.0882 (UTC) FILETIME=[8AEC5720:01C73BC1] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.67.0.133 Bart Schaefer wrote: > } Note that ";|" provides an OR-like separator (as opposed to the AND-like > } ";&" separator) > > This analogy doesn't work. Semantically, the test for whether $mycase > matches any one of the labels occurs once at the top of the statement. > Control then jumps into the body as if with a GOTO, and thereafter all > you're able to change with ;& is how early you exit from the body. It > isn't anything like AND / OR. > > By comparison, your proposed ;| requires the interpreter to reproduce > the pattern match test at every label, which implies storing the result > of expanding $mycase, etc. Most languages don't allow one to hide quite > that much complexity behind syntactic sugar. I think we simply have to apply the restriction that the word in the case statement is expanded only once at the start of the case statement. I don't see that's either unnatural or confusing. With this it looks like it ought to be quite straightforward, possible even trivial, to implement. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview