Re: [VOTE] Shorter Attribute Syntax Change

From: Date: Sat, 15 Aug 2020 20:07:57 +0000
Subject: Re: [VOTE] Shorter Attribute Syntax Change
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  Groups: php.internals 
Request: Send a blank email to internals+get-111541@lists.php.net to get a copy of this message
I am for stopping the current voting too - because the results are very different vs. the previous voting, they are almost random and the discussion is still very hot which violates rule when voting can be started. My personal opinion on the attributes is: - allow not grouped syntax (with @@ or @:), because I think it is much better as code is 2 lines shorter or it is very badly mergeable with conflicts - comments should stay holy, ie. syntax with "#" is not a good choise, program should stay unchanged when ~/\*.*?\*/|(?://|#)[^\r\n]*~s is removed With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek On 15 Aug 2020 17:36, Peter Bowyer wrote:
On Sat, 15 Aug 2020 at 16:07, tyson andre <tysonandre775@hotmail.com> wrote:
I also want a revote.
I do too. Partly because of the rules, but mostly because this discussion has gone on so long I am now less clear about what is an "ending delimiter" and why it matters than before. And whether the begin/end delimiters are part of each attribute, or used once for all attributes. For example, https://wiki.php.net/rfc/shorter_attribute_syntax#lack_of_nested_attributes. Derek and Benjamin's RFC shows no nested examples. Are nested attributes even a thing now or did they disappear in an earlier RFC? If they are, they should be featured. On another topic, parentheses and ending delimiters. I have heard Derek's distinction, but if we're after a syntax with an ending delimiter then I would propose compulsory parentheses, which means all syntaxes @@, @:, you name it, would have one. If that's unacceptable for solving the "ending delimiter" issue, then document it in the RFC. It feels there is a lot bound up in the lexing, either by PHP or by how different people read and understand code. I'm stabbing in the dark for reasons because it's not been explicit - and it ought to be. This is not a comprehensive RFC, and while I'm ambivalent about syntax (having swung between <<>>, @@ and #[] over time) I do not appreciate feeling that it's being bounced through. Room 11 is not this list, and discussions that happen there (as earlier messages talk about) provide background and context that is missing when reading this RFC and not having been part of those discussions. P.S. the RFC introduction also states that *"The main concern is that @@
has no ending symbol and it's inconsistent with the language that it would be the only declaration or statement in the whole language that has no ending termination symbol."* I had mentioned this in (https://externals.io/message/111312#111335) that this statement failed to give concrete examples of problems (e.g. parsing ambiguities) that the authors believe could be caused in 8.0 or in future releases. I'd also stated that I think an attribute is neither a declaration nor a statement, but that could be resolved by including the definition of declaration/statement used by the authors. There are various syntaxes in PHP with no ending symbols (clone, public, yield). (I doubt changing this will make a difference since many people prefer #[]/@[] for other reasons, but still consider that sentence to be misleading.)
Agreed. Peter


« previous php.internals (#111541) next »