Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109494 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 507 invoked from network); 1 Apr 2020 10:30:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Apr 2020 10:30:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C312E1804C4 for ; Wed, 1 Apr 2020 01:56:58 -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, 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-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 ; Wed, 1 Apr 2020 01:56:58 -0700 (PDT) Received: by mail-wr1-f42.google.com with SMTP id t7so29521694wrw.12 for ; Wed, 01 Apr 2020 01:56:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=G6YbAZFXUnwxgm16qlspkfmTgG403ZZlDBH20ArHxgk=; b=Nbp5fYKUhEX4kK5hpSQ7f5SgmEVfCoHC/1eOpOO5C/m9qRTB56zJb6oMKGoblZ2xfD X74IF2g1qnPRMNcN4kYp//cfRoDBUB8RYxF6yLsclFAPI6rbdeo/r3nqzYS0atNymkp+ NLnYzc24zEk+2Glf/C+Hnjt0NLK55YbwMVVFTAFSuJ2O1vXlm4mskulnWhJ4/lXW3hhX 0eBCh8AHz8O1I11DOb8kGSEi1vVy4jyp5+GZp85w3r4vQZCIcFHVtx8KNzEirCw3hsCY 6NIHjRTiX5M/7DsfqfT0SleTKvKP/dXPs9npEb4HaAAdfvDtHW431A46jTl2XWG99mla mBSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=G6YbAZFXUnwxgm16qlspkfmTgG403ZZlDBH20ArHxgk=; b=MS17AIQ3v+Vm27UGgJuWm+qRVbpSUwCOFbs09ZxUJfb1hu3IFDxKWaR8Ju9l3JTprL u4Ew3Br8R04KtM8phd7J1F50sF60//X8VPAeP32QGw8VUtDsBr2Agm+eQA9rdxagN8+V Si9cBtcxr6xSOL5lPMX8/XgCT8vLOgih1EUgpGaGznUqeP3fZFwSj7MoAdKIhiTmAdXr kdq5FpKad7MUG5o5SPazb9MK6Ea6ObIMruZUMwqhd+WZp+Xmc4EUB7RSyekr8RwBlDfb LRk+/lxXGh47sprJ/KoOLTrY9THWbcgajmFIvnJaeb+JYQ1pwgMiw0uFEdpwcEXmm1xY wlwA== X-Gm-Message-State: ANhLgQ1439UhW9QLKXySrvpSPIUJytwkapweRP/+nHk5nmVSsA0FKiUt aZUf1amKwWNG0JA2VkEChc/eFe9z X-Google-Smtp-Source: ADFU+vuwYZJkQ1pyReHsbDjhS8ZuKgM8WKDrm0hbakg95LjHPc1FmyP8EtEXYPxDEp2BsW9bIlWy+g== X-Received: by 2002:adf:c511:: with SMTP id q17mr25205836wrf.275.1585731413686; Wed, 01 Apr 2020 01:56:53 -0700 (PDT) Received: from [192.168.0.12] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.gmail.com with ESMTPSA id f20sm1727664wmc.35.2020.04.01.01.56.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Apr 2020 01:56:53 -0700 (PDT) Date: Wed, 01 Apr 2020 09:56:49 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals@lists.php.net Message-ID: <7E3BE38A-1DAB-4523-871A-7AAEE0E697C4@gmail.com> Subject: Re: [PHP-DEV] [RFC][POLL] Switch expression From: rowan.collins@gmail.com (Rowan Tommins) On 31 March 2020 19:50:59 BST, Ilija Tovilo wr= ote: >There's been a fundamental disagreement on what the switch expression >should actually be=2E Due to the conflicting feedback I no longer know >how to proceed=2E I think this confusion is there in your proposal, not just in people's res= ponses to it=2E=20 In the new poll, you say this: > The question seems to be if this new construct > should be a variation of the switch to make it > usable as an expression (like the RFC currently > suggests) But the introduction of the actual RFC doesn't even mention the expression= part, only that you want to solve some of the problems of the current stat= ement: > The switch statement has some long-standing > issues that we're going to look at in this RFC=2E=20 You then go onto describe 4 problems, and propose a new syntax that solves= 3 of them, with only the type coercion part retaining the switch statement= 's behaviour=2E I don't think people are saying they *want* the proposal to be more of "an= alternative to the switch statement that fixes all the issues mentioned in= the RFC", they're saying that what you've currently proposed *is* that rep= lacement=2E If that's the intention, using a new keyword would make sense= =2E If the intention is to make this feel like an expression version of the= switch statement, then making it look more similar would make sense=2E I think it's ultimately up to you which direction you want to take the pro= posal, but you should pick one and follow it through=2E=20 Personally, I think changing the keyword to "match", and possibly using st= rict comparison, would make a compelling feature=2E I don't think this part= would be needed or desirable: > Each case can contain a single expression, or a > block with a statement list if the expression > result is discarded=20 I think it's perfectly fine to have a match expression that's built only f= rom expressions=2E If someone wants flow control, they can use other featur= es, the new syntax doesn't need to do everything=2E Regards, Hi Ilija, --=20 Rowan Tommins [IMSoP]