Re: [RFC] Match expression
| From: | Dustin Wheeler | Date: | Sun, 10 Sep 2017 20:35:17 +0000 |
| Subject: | Re: [RFC] Match expression | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100512@lists.php.net to get a copy of this message | ||
On Sun, Sep 10, 2017 at 4:18 PM, Rowan Collins <rowan.collins@gmail.com> wrote:
>
> The choice of "use" as the keyword was largely because it's already a
> reserved word, with multiple meanings in different contexts. As well as
> anonymous functions, it's the keyword for importing names from other
> namespaces, and for including a trait into a class. I would be perfectly
> happy to hear alternative keyword or syntax suggestions.
>
FWIW, within the scope of the suggested "switch-use" feature, I think
that the "use syntax", as suggested by Rowan, feels appropriate. I
agree with the usage based on it already being reserved and used
differently per-context. Additionally, the syntax feels natural and
expresses intent well-enough. All that said, I feel that some form of
strict-switch would be more immediately applicable to a wider
audience. In that regard, I prefer the keyword approach "strict switch
(...) { ... }" rather than using an additional parameter "switch($x,
true)".
--
Dustin Wheeler | Software Developer
NC State University
mdwheele@ncsu.edu
"If you don't know where you're going, it's easy to iteratively not get
there."