Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110697 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90954 invoked from network); 22 Jun 2020 17:18:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jun 2020 17:18:55 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5B99E180508 for ; Mon, 22 Jun 2020 09:05:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 22 Jun 2020 09:05:53 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id i27so19915791ljb.12 for ; Mon, 22 Jun 2020 09:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=titHnudJmBZ/qk1f1FooRzsEa46YH5NVsM05uT+rX+s=; b=pBv9ZDss2yAyvy6t3im20XTcQQkZHGb23zXXy7tv8ETCyF3OBb7xXpp7+f0xESHP4p e8UjSX6KSwb7PIFZS2lDagDcxykqqEjL74kmI0lXg2yunl8tUwkkJJiaU27bKErsKn3N KgYykLsFR/Fbju0K/iiBbNdNHkvfZiZqM0ZGPlTisexT4IuCAlYRA3LPZ0hq+vAPyhQK eW/IJBYcBQHZK7M3CMnibwQc/jpt9AwXLYUbGq0EhzjU9NHfeOfGnZM+IHKVY4K+Qreb OAY45wCG8tjpv7rkHL+P8KAanz3KtW0GI2M2qEKyVdH0oguVdajQGRjGRrhz7VW9Vyy7 bDbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=titHnudJmBZ/qk1f1FooRzsEa46YH5NVsM05uT+rX+s=; b=lN8rOVYOIESPSdRFaZmv/tXMD1a0ZNkCv2balgguhCiczS7MAxarkz3V0q6AP07tsr lN+B7cK/atUSoemyNBAVEwc1f53mmfJYkUcaLLeFXK0HTiXarUZYIYw+wlLml+KAotnD jPSD+KawQpY58ylARXMNHVGTaAP/xtKpT9y/4Ab4AmEdX7Lly+Ok9oAr+np07yOEW6Se /Egj3OBD0Osprm94ROXKp8CVRV3BvkZeeZjFrLwgqrHrOVka5lOHkjmTAcLD58jDj197 fiDyYYO5AQCHcgrpMvQA8CrYqw0M/jbqtbfrG3OOIOWlCCKWlFBLrah05U151KGfd2tU QMIA== X-Gm-Message-State: AOAM532XUz8VJga76LKoa0FHZG3MqOhuS2HI9hnuF2JSmD0DeNichzBF OaAl/wD+PFKnK/gGVFwK/UsipaUhObLGqaKD1qguCg== X-Google-Smtp-Source: ABdhPJwLe9w7R1kDQxNBSnshrc3evgquv7d6TsBVT1l37lF/bBiwu6cTiCKHrwQ0mk6mjWHVnPVtLe7i8S67rC2bFiI= X-Received: by 2002:a2e:581a:: with SMTP id m26mr9102651ljb.0.1592841951781; Mon, 22 Jun 2020 09:05:51 -0700 (PDT) MIME-Version: 1.0 References: <37f1f8fb-0e1b-cc39-f4b6-6c943a731d49@telia.com> <250b7671-2919-9385-c149-931212397e4b@telia.com> <04d86e2d-0815-195a-6111-3034e0ca5918@telia.com> In-Reply-To: <04d86e2d-0815-195a-6111-3034e0ca5918@telia.com> Date: Mon, 22 Jun 2020 19:05:39 +0300 Message-ID: To: =?UTF-8?Q?Bj=C3=B6rn_Larsson?= Cc: Ilija Tovilo , PHP internals Content-Type: multipart/alternative; boundary="000000000000b8281505a8ae6a95" Subject: Re: [PHP-DEV] Re: [RFC][DISCUSSION] Match expression v2 From: benas.molis.iml@gmail.com (Benas IML) --000000000000b8281505a8ae6a95 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jun 22, 2020, 6:35 PM Bj=C3=B6rn Larsson wrote: > Hi Ilija,Den 2020-06-18 kl. 22:51, skrev Ilija Tovilo: > > > Hi Bj=C3=B6rn > > > >>> I'd like to announce the match expression v2 RFC: > >>> https://wiki.php.net/rfc/match_expression_v2 > >> Well one could argue that when working with legacy code containing > >> switch statements where one gradually migrates to match, it might be > >> easier to have the same separator, i.e. ":". > > I think that's somewhat of a moot point. The syntax of match is quite > > different (match instead of switch, no case, no break, colon instead > > of case, comma instead of semicolon, trailing semicolon). Just making > > one of those the same doesn't make a meaningful difference for ease of > > migration. > Agree on that! One thing though. Is semicolon mandatory or is it optional > like in the first RFC? Feels a bit odd with a semicolon after a curly > bracket. > It's mandatory since it's an expression, not a block. Another example of an expression would be a closure: ``` $fn =3D function () { ... }; // a semicolon is mandatory here. ``` >> Is the proposed =3D> separator inspired by Rust or Scala? Checked what > >> other languages used and for switch it's ":" of course. So one might > >> argue that to align with match statements in other languages "=3D>" is > >> a good choice, but OTOH if ones sees match as an enhanced switch, > >> having ":" as a separator is another alternative. > > Since nobody else asked for it, just for you I compiled a list of > > other languages :) > > > > https://gist.github.com/iluuu1994/11ac292cf7daca8162798d08db219cd5 > > > > The conclusion: Most languages also use some form of arrow. It makes > > sense to me to stay consistent with those languages. > > > > Ilija > > I think this is a very good motivation on why select =3D> as a symbol and > I'm glad it's listed in the RFC. > > r//Bj=C3=B6rn > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --000000000000b8281505a8ae6a95--