From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.58.187.107 with SMTP id fr11mr20287333vec.34.1401854746694; Tue, 03 Jun 2014 21:05:46 -0700 (PDT) X-Received: by 10.182.216.235 with SMTP id ot11mr3397obc.35.1401854746521; Tue, 03 Jun 2014 21:05:46 -0700 (PDT) Path: border1.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!j5no978210qaq.1!news-out.google.com!gi6ni19621igc.0!nntp.google.com!h18no220262igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 3 Jun 2014 21:05:45 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.252.147.203; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 71.252.147.203 References: <36324571423534039.464516laguest-archeia.com@nntp.aioe.org> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: a new language, designed for safety ! From: "Dan'l Miller" Injection-Date: Wed, 04 Jun 2014 04:05:46 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 3639 Xref: number.nntp.dca.giganews.com comp.lang.ada:186719 Date: 2014-06-03T21:05:45-07:00 List-Id: On Tuesday, June 3, 2014 8:19:03 PM UTC-5, Dan'l Miller wrote: > On Tuesday, June 3, 2014 7:21:45 PM UTC-5, Luke A. Guest wrote: >=20 > > Quel surprise, it's YAC (yet another C) Calling Swift yet another C is somewhat disingenuous. For example, the swi= tch statement is drastically reworked & expanded to be based on patterns in= Swift instead of based on itemized integer values in C: =E2=80=9CA switch statement has the following form: switch control expression { case pattern 1: statements case pattern 2 where condition: statements case pattern 3 where condition, pattern 4 where condition: statements default: statements }=E2=80=9D Excerpt From: Apple Inc. =E2=80=9CThe Swift Programming Language.=E2=80=9D = iBooks. https://itun.es/us/jEUH0.l =E2=80=9CPatterns A pattern represents the structure of a single value or a composite value. = For example, the structure of a tuple (1, 2) is a comma-separated list of t= wo elements. Because patterns represent the structure of a value rather tha= n any one particular value, you can match them with a variety of values. Fo= r instance, the pattern (x, y) matches the tuple (1, 2) and any other two-e= lement tuple. In addition matching a pattern with a value, you can extract = part or all of a composite value and bind each part to a constant or variab= le name. In Swift, patterns occur in variable and constant declarations (on their le= ft-hand side), in for-in statements, and in switch statements (in their cas= e labels). Although any pattern can occur in the case labels of a switch st= atement, in the other contexts, only wildcard patterns, identifier patterns= , and patterns containing those two patterns can occur. You can specify a type annotation for a wildcard pattern, an identifier pat= tern, and a tuple pattern to constraint the pattern to match only values of= a certain type. GRAMMAR OF A PATTERN pattern =E2=86=92 wildcard-patterntype-annotationopt =E2=80=8C pattern =E2=86=92 identifier-patterntype-annotationopt =E2=80=8C pattern =E2=86=92 value-binding-pattern[=E2=80=A6]=E2=80=9D Excerpt From: Apple Inc. =E2=80=9CThe Swift Programming Language.=E2=80=9D = iBooks. https://itun.es/us/jEUH0.l