Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111444 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96538 invoked from network); 10 Aug 2020 17:28:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Aug 2020 17:28:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9E34118054B for ; Mon, 10 Aug 2020 09:27:43 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (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, 10 Aug 2020 09:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1597076861; bh=bdvb7qHvHa8r72FZcty4OBYJL9CqK57urAKz3lLf8SY=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=PBc8xFm6e0JpgMBL6hZeFLQrQ8z6i1AhE1UcBK9umv/fcjVp4LUIbgrNjCb0esEL0 asuIoWhR77w3o0hqesmG/CIMYURusSETh3CtRJpm+0RvC98YmXL83sipYbWdrAgCHl OUiKYmIdsJKESqUPKx/nWUZjbIzB3XRwau88lqNQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.120] ([24.134.51.41]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N0X8u-1ksiOO2tvw-00wSdD for ; Mon, 10 Aug 2020 18:27:40 +0200 To: internals@lists.php.net References: <5c73b8d0-f477-83a0-4bd4-2fb8d11ad416@seld.be> Message-ID: Date: Mon, 10 Aug 2020 18:27:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Provags-ID: V03:K1:EOUEMb2GKkVDqgCmYkCOzwusK19+FgwV2kcOQ5YgCfI1BerJJUu Ov/c/JDOmUJwkSltISEB7hocq8DPyAw42OqWHik/NBPw3DOOT5eqcweATt2skHgY+Ozyotd 1gawZTemdTDgEJI1PRmUOYOQe+fmry9UOif4R8UGsJ2ysVE8cCkZzw7HIhYv5ThSdFN5RDN ofygYrQGD5og9y/q+h5jA== X-UI-Out-Filterresults: notjunk:1;V03:K0:xMz/HsNjfa4=:P6eVEUGxrYPTgrV0XMuQRs SdYMGw636b+Ris5rhoqjTnybnnKm3p+4V1jIH40ZjtTzww3tXnq5zv7fGgstTLn8U+1UALkiB Z/5gmQpoUkFZHtKtbRWEz1cKbR2kolAxrmxgGEySc4YnBHr1uKl0puQxPNkz+lm8TAtbwUw+n exGaWLQNAWJ1Bb+76qgdK1S55zDsyTFQNZ7piYKsNarChFnweU+18rjw99xFEsNQA275UK84S OvWc9daheSwJYpdjImPamdqdIB5v5m91nhilUMu+D34B1IzyWqf87M4Jy8rPXQlJ6kZOtX0fK p0XuwcZ9TQ9BHAXSvFeZE+p33FpWFZrx/BetbgEGGMJboV7A0RgpvCZsqmPSOY2IkvhSWmuaw kmEKsRKxtPHeO3psXMMDsE3q0vxU/yO39rSN4cwy3puy0XYCB7htjm7YKUGIMU6SvZmpXYHgw KqzidRzS/E7tPys/KUHsdzQt5ZalWKQeQnHEkUP8iNna+zLn1xXgqbkPpgAbiYZGqHYcrTFoZ 2Xc9Ss15SA2i8c+2sPgF8+Gk6ezVxVx4PynwWgZ85e04iLIVVMvso5HFva6SBIXGBUtSXUcxd mQdm0pXmlQj4mWXBlGP4hhBaVohEjO5gTA7cNjIXhWkySZ7xhnfuBErmII6o4YdCTiVm+Ribb p1d7hAVelvfqt3yWNq+4Kcf79OpjsWrfUBYQjJ/kaRXNizRhenGHDyECovNqgQWhrVVj9gL9O 2lWFxT+gOpJcXdD6pXTtydF/sarB4NLnijDWuq/W7l78+f3uKb5gXKxCfaKFZESze57RoO8dR Evj0ATHh5Wl1HOGUYaJe94B7uXO6L7eKSEDr1q19L3AgMK58zmWDMiqqoNy1rAKHFfCdwk1hq aywpB+jUP1nl/7NTAw+GPOsVm8feYJvqc7nG1qryifSgF7VHF8AUllrCLZF4xPXPsBMfEAGVl kkHCK6wCb2XPgy2E/nJ1hpI7+0Cy7dHPjHqATQhYMhVQVHgRjqUIGiDPvhQeshzP+6Ws8BxAH kyCrbPgvPd8SuQCyeaSTLFtbXd/oe7CwUkYqaRqlcN9gW3HUbADZn8KV/t884yhxfoje81aAP hqZnHGtmPfp0s4tCgk5SjKNGjkYBX4j/sh4fO7onrJT5WL9sTf9SyH9FcjLD2tTzFxYEpivAV D0PckRcqvV052EPvHLrdKlAz0aui77RHuBk4kRgoVU7ifybwFTl0k+UoRFO0VjwNcyrq9CwSO FZTRquqT/Y8/8zFN0Q7bJ9/i9nPhCwqMDpCya2A== Subject: Re: [PHP-DEV] [VOTE] Shorter Attribute Syntax Change From: a.leathley@gmx.net (Andreas Leathley) On 10.08.20 17:40, Derick Rethans wrote: > It missing an ending delimiter was my first reason for wanting to get > something better than @@. I don't particularly care much if it ends up > being @[], #[], <<>>, or other things such as @:( ). > > If you have something to open, and close, there there is a distinct area > that forms the whole definition of a thing. That's why functions, and > classes have { and }, if and other control structures have ( .. ), etc. > > Being able to define a whole "thing" easily with an open and closing set > of symbols, allows for better mental parsing. It also means that syntax > highlighting tools can map the opening part with the closing part. (VIM > for example, uses the % character to jump between opening and closing > symbol). For me the difference would be that with attributes, you are not opening and closing many possible statements, it can only be one (or more, with grouping) class name(s), which then can have arguments, but those are enclosed with (). In comparison, classes can have many possible definitions inside of them (class variables, methods, constants, etc.), so enclosing them clearly makes sense, as you need to know where it ends. The same goes for if, for, while, etc. So if you just have one class name as an attribute, enclosing it seems a bit overkill, as there is already a definition of a class name and how it starts and ends, which is why for me the mental parsing does not seem easier - but what is easily parseable probably depends on many factors and might be different for different people. I would have found a syntax where the delimiters are optional preferable - similar to "if", where you can leave off the {} for exactly one instruction, but you have to add them if there is more than one line of instructions. Or the group use syntax.