Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111342 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 268 invoked from network); 5 Aug 2020 15:06:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Aug 2020 15:06:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E9C1C1804DB for ; Wed, 5 Aug 2020 07:04:05 -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,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,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 mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (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, 5 Aug 2020 07:04:05 -0700 (PDT) Received: by mail-io1-f48.google.com with SMTP id t15so37071735iob.3 for ; Wed, 05 Aug 2020 07:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=LcIvkQCenbfz1fHtgkfa038hQM5ENbmd4Bc70ZSAJ38=; b=ETRArh2N+thwoYziHna9qx8gUe26RVDSudVj4Nzju5ukVazv4qCYM3QtVJi2qCHrd7 jjFqqwKM5lEWTxA8+y96QH4axLUj+NrWupqAXOXA3KIBuM8jDARUFL/J+U2HSVgbNeA0 Wtq6JI7dZRF1rYFWrxRYcl9BLcmKsdxSGE+0xPfSpEQWGMb1bkbsXEjMLNWauinolGpY ie8EyF4YyDwjaw57pAzYu+k7K595QHSgEIKWFflvvgWLnUFga5eTHQC1XsSgp+8etDK0 bdMBT+mVkF+WfYi/36l5jIa/kU0DkxhYutYmQs7eXif+g7MaRIR880OMFK3r+fBlgJBv LH+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=LcIvkQCenbfz1fHtgkfa038hQM5ENbmd4Bc70ZSAJ38=; b=uU4ARFUv0U+nhJ0+G7WNzQsSEIPWxbDoEiqag8+XY6TjnWWkP1GzQRQfCXvmWhsm5Y lu2+7rUiu3NQmONz1uMiJz2BBCqe4XWSCXB4/WiSf27UpGjRgwxMSd4oEsfLcNZXyWK7 GOwhWghzfcVopMI6S3jhgx55JH4IJvc7jSez0+r6V8PQZNDbB1K1g1KpD7DSDX8pfxFN WFXcq0A/iJrHWgMyqKTPdX734HlGctL8NxFI41MwxUnSoo49cuK3iKBar304pFVCiEHL r8fkLOxjrHBZF7V+/kigNZITw/Ds4EMjDXjYMdZ6vPwof/0GudrwMti5i60OEEYvoOKT quwg== X-Gm-Message-State: AOAM532gGUKami9b9fME6q/M/6pmSYwfl2jQkZKzf0byAjptNtJdva5d 7rqQDPnzn+rumPig11CD2dUvaU8996vWENwnv8VDyDmx X-Google-Smtp-Source: ABdhPJwiVlBjjlWfZ3MUgZf19J8+QpGuBMlSPgMGT/p/CPBDz0aDeMw3XVoZKYmCHNTbH3HWTr53F+oBfVyJyZQyVas= X-Received: by 2002:a02:b610:: with SMTP id h16mr4564587jam.74.1596636244375; Wed, 05 Aug 2020 07:04:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 5 Aug 2020 15:03:52 +0100 Message-ID: To: PHP Developers Mailing List Content-Type: multipart/alternative; boundary="0000000000002eb83e05ac21d894" Subject: Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2 From: rowan.collins@gmail.com (Rowan Tommins) --0000000000002eb83e05ac21d894 Content-Type: text/plain; charset="UTF-8" On Wed, 5 Aug 2020 at 13:20, Benjamin Eberlei wrote: > > It looks nice for a simple attribute like @@Jit, or for a one without > arguments like the used @@Deprecated, but as soon as there are more than > one, and they each get arguments, enclosing them has its own benefits over > them just standing for themselves. > The confusing thing about this argument is that as soon as they have arguments, attributes will have an ending delimiter _whatever_ syntax we choose, because nobody has ever proposed removing the parentheses around the arguments. Detecting the closing parenthesis requires pairing off any parentheses inside the argument list, but that's still true of the closing bracket in @[...]. If we make the closing delimiter some random combination like @#]] then you _still_ need to parse the arguments, because they could contain a quoted string with those characters in. While I'm generally in favour of delimited syntaxes, I'm struggling to see the difference in value between "parentheses are mandatory even if there are zero arguments" and "the syntax includes an extra pair of outer brackets". With no parameters: @@Foo() @(Foo) @[Foo] @[Foo]@ With complex parameters: @@Foo('hello @@ world', (1+2)*3) @(Foo('hello @@ world', (1+2)*3)) @[Foo('hello @[ world ]', [1,2,3])] @[Foo('hello @[ world ]@ again', [1,2,3])]@ Regards, -- Rowan Tommins [IMSoP] --0000000000002eb83e05ac21d894--