Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102273 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55345 invoked from network); 15 Jun 2018 09:44:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jun 2018 09:44:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.19 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.19 mout.gmx.net Received: from [212.227.15.19] ([212.227.15.19:48513] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DD/42-29356-76A832B5 for ; Fri, 15 Jun 2018 05:44:08 -0400 Received: from [192.168.2.105] ([79.222.35.93]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LyWAQ-1gGh3i3Er0-015uMv for ; Fri, 15 Jun 2018 11:44:04 +0200 To: internals@lists.php.net References: <82788099-3fba-282a-8d28-68b0ea3276be@php.net> Message-ID: <048ed6c7-2bf5-537a-759b-79fd1767e65d@gmx.de> Date: Fri, 15 Jun 2018 11:44:07 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <82788099-3fba-282a-8d28-68b0ea3276be@php.net> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:Pb6SB72W/TCjW7p9fmvA0COZq5fQgDMLbowlxKMz1Z/Mk64wZXV 0YPah4zqEAx11kbiPnwF9X0zDR9qUG9uapIi7RcoLkK/qyntMDQ+E5t9fdGOZcf1rozWp1x 8o/MZ4mHbPY8T469/rUL7WiVE4tthmu3LTj7xOzc1cUbCuqrKpq11jsk+kjYAeTqv/oPQNG FeyKghMKEd9FyMLPWAnYQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:zJw+JhceuFw=:p3gQkpoR3hLp4KKH2OWzDJ +Jx0lGnrqu96fM4C9dwxTnnd/KQzuXGKTcFjI1pMWvjC/X0JQiKS5oQQB9+0GOljUIMZWq32c Jlg13j1f3gTrm0HV2rx5AjoOW0D79vV3SAT8fcYi7t186oY9g5HE1nczzImDB1+9v2/WUly5n MQmdrWb/7oLmRaSEcgRjtWTk2BWM7wkOjpaCwAaHRravGQ+umN7Q4eO3RWZ1E2CQfs2QAPmpA 9WE7MH0pA3TOVWyIR02V6FD8nEZ0pxNIIhzgosXblDsKrVL3vKoAMEwHGmRMp+wpo0nOeJcRN 8JltkUCFyB5T9LsbIbC5nIsBThCoxwi/4mdGEWh8GF2LIFlr4cDL7WrByqQLu51NVMldR7Tlm ZHkeeECkGZzypMLVMkyrB1GQDtYHv0u+Fet0I9rfoRKVfJN86OaEwplqj/4liUsVAaqV5rMNb 5Ke0sO2BL6xnyd55QffKlWdwHqlcHFFLEShL90m942emaZFHeo2woF0ylmDdjv9JNT6nfjDDn e6GVNU5IMoEOjydaiP5rg02TPDm1GcOXObSyZpELqSseepXqFEgKSXeF1lQJHgtz4LGp93Sk+ XD9Brs+cBlr5lAZUfPWS0INJ63ZR3TzX4CtQduPSA+bv517RRMByPhbxPl0UMGFwB5e6ngGbv 6Lv35GmhMFseypznVx/XLKmUblVCF04Ejjp8mOehFIn6b9Y+2szgw2LNFURyqxKTbL3ZN01PG O8kkTaI16SymOfJKPZJfEZalT0pXSocGxF7fA8py4aIpG8+d48jflYzS7qoN3Zxyf8KC1c+qQ i7/r0+e Subject: Re: [PHP-DEV] Strict switch statements From: cmbecker69@gmx.de ("Christoph M. Becker") On 15.06.2018 at 08:36, Sebastian Bergmann wrote: > Am 14.06.2018 um 10:35 schrieb Nikita Popov: > >> It might make sense to introduce an entirely new "match" statement >> that conforms a bit more with how switch-like strictures are >> implemented nowadays. That is, something like >> >> match ($expr) { >> "foo" => {...}, >> "bar" | "baz" => {...}, >> } >> >> or similar. > > Interesting. Can you provide a pointer to a language that has a match > statement like that? This match statement (or would it be an expression?) could be regarded as an extremly simplified syntactic variant of the case-of expression of Standard ML[1]. Instead of the pipe operator we could use a comma to separate multiple “patterns”. Using “case” instead of “match” appears to be something to consider as well. [1] , section “Pattern Matching” -- Christoph M. Becker