Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110400 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 91900 invoked from network); 6 Jun 2020 13:23:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Jun 2020 13:23:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ED14F1804E0 for ; Sat, 6 Jun 2020 05:06:11 -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=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 ; Sat, 6 Jun 2020 05:06:11 -0700 (PDT) Received: by mail-wm1-f41.google.com with SMTP id c71so10749128wmd.5 for ; Sat, 06 Jun 2020 05:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=MtChYoG7W4XAG7k2b8VK0Rz7zMv/bInJD2t2UQspVak=; b=bTEieG3RilrDveU19TCtqc1Zsz3Dpkkum9kOstFv/cLbWtYJBWQSN77q234SzRCZ0d zL9Q+VLh20TP42J3M/qePlRAOzN9KE+/YXF4Neu5zl+pLn1ecOmU666E8BELQQ2Gc9qD bov1HRlNj6lDDUYw8K0MYCWs3ogp+272VzuDYO+QRDVwTRLZ/HtqI3KmwtRQBDOE4COd e8TR7O040xXWPt6opU8jzGzTw37elEUxNJrCGvBjyjyQ0RYQnvM5eket//S2P6/DC9vA 92yUgZwovBubiDtxq2efPVSsyfuf4/bUcfVSyfLkzaBgyLe74M3PzDI5yVGO2IK+5/mI WuYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=MtChYoG7W4XAG7k2b8VK0Rz7zMv/bInJD2t2UQspVak=; b=fyta2rwloSBTZzvyv0AsSycF7uXQoS81PPcvMzH4L2GMduKsONmMVOin8hu9+R7VW/ S4IEJy7KheMO6S2+v58zCjt4h/LXgohoI3T2KcHRmkwrmoMgF5Jv/5I01RO5z4JS0dql U5vK0F5ru3odB9F0+nzlzzIsWkqrxoBc6tbQ7hgk4d4HLhHfSTgyjzAOmcNBKuMqgyL3 AqlNkvzlyaws9LgZrxxpBm/hHmzwBEs1u3xXF8jnZ4nQuCKqBvsyNHAXIbHq7eIp5Ijf kjA4TVxr4+j8S2zCjiU4aKcMH+82QOuUdfpus7Kz+jiJ4PFLnnU1L1+ZUxQgEQ1U1z8t mSyA== X-Gm-Message-State: AOAM530qPX3kAyTSOWRTmyoxbEWH81Zibpd2TtCAodqgixfDTuJw1Ptc 5EgOxPwu4eUNdjQ/ezqry8REMRfz X-Google-Smtp-Source: ABdhPJwei1Vu19biGZ8RNTt7eKPzsdSJSZHAbROCErkAXcMfzSA+6TfD9elAk/q8y/GV4Oq4J1TRpQ== X-Received: by 2002:a7b:cb4e:: with SMTP id v14mr7675768wmj.54.1591445167328; Sat, 06 Jun 2020 05:06:07 -0700 (PDT) Received: from [192.168.0.22] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id a6sm15050913wrn.38.2020.06.06.05.06.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 06 Jun 2020 05:06:06 -0700 (PDT) To: internals References: Message-ID: Date: Sat, 6 Jun 2020 13:06:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] [RFC] Shorter attribute syntax From: rowan.collins@gmail.com (Rowan Tommins) Hi Theodore, Firstly, sorry if my previous e-mail came across overly negative, I wasn't in the best mood when I wrote it (gestures vaguely at the state of the world). I think this is possibly the best line I've read all week: > Well, I guess the line between objective and subjective may sometimes > be a bit subjective. :) Ultimately, it all comes down to judgement calls - is the double-angle-bracket syntax "too verbose", "too ugly" when nested, etc; and does the double-at syntax make it "better enough". So I'll try not to get into endless back-and-forth on every point, and just pick up on a couple of things. On 04/06/2020 23:20, Theodore Brown wrote: > Also, grouped attributes would probably have to be special-cased to > be disallowed in nested attributes, since they don't make sense there. I'm not entirely clear how they work in current implementations like Doctrine's, but I think nested attributes would have to have completely different rules anyway, because you don't access them directly through reflection in the same way. If <> )>> means something like "new Foo( new Bar )", then I can imagine it being useful for <> )>> to mean "new Foo( [new Bar, new Baz] )". That would actually be more convenient than the double-at version, where you'd have to write @@Foo( [ @@Bar, @@Baz ] ) or use a constructor with a ...$variadic parameter. > I don't understand how it's disingenuous. The RFC refers to the shift > tokens as such because that's what they are (`T_SL` and `T_SR`). The > proposed `@@` syntax uses a new `T_ATTRIBUTE` token. The "::" token in the parser is called T_PAAMAYIM_NEKUDOTAYIM, and personally I find T_SL and T_SR just as cryptic and irrelevant. The most common place I see those token names is when accidentally running code with conflict markers like "<<<<<<<<", or when messing up heredoc syntax; even if they weren't so abbreviated, my reaction would be "shift what now?" I've used bit-shifts maybe twice in the last ten years, so it's just not an immediate association to me. "Disingenuous" was probably too strong a word, but I do think it relates to a fundamental difference in viewpoint: to some people, << and >> are first and foremost the shift-left and shift-right operators, and so the immediate association on seeing them is so obvious it's not worth mentioning; to others, they just look like a new kind of brackets. That association might actually be a good reason to avoid that syntax, but if so it should be spelled out, rather than taken as a given. Regards, -- Rowan Tommins (né Collins) [IMSoP]