Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111941 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51807 invoked from network); 28 Sep 2020 11:13:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Sep 2020 11:13:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0E9371804B1 for ; Mon, 28 Sep 2020 03:24:45 -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-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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, 28 Sep 2020 03:24:44 -0700 (PDT) Received: by mail-lf1-f44.google.com with SMTP id d15so597764lfq.11 for ; Mon, 28 Sep 2020 03:24:44 -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 :cc; bh=TAPJrslEtmBYFO8M8zMZFO+cbqJJer/J5l88RrP0bY4=; b=Cib4JJP8w9LuLPi2CCv5kzAJwiNUqpYMOc7dBMozGwgaPypGsT02MGM6IqohSXWzvK tW3PFkeqKjeH37b7HOSLDdH6iYeiMBJ2XhpX1ytO1V5srbeTCB/BKcezz3O04EjuMbfr vgFdGbt39aq585PjkEEnJ8k7OQ/q+wJMNKP3SM61pgNRpqftEBH+XAkDYqh7pdO4bCqu COmkxjx2AmFncMBrfV+lrDbY6k3lvG8bTO02LztVLaGKAlw5W5WOA/xUMFK1USZAvSrl 1r7fPFiCDQcQkCVfXfmmSgAGJUYo8SOjrRzJ3Zvm6R0A5a8vVjUsfw+YtalvFNnf3B+T /7oA== 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:cc; bh=TAPJrslEtmBYFO8M8zMZFO+cbqJJer/J5l88RrP0bY4=; b=Lzs+S+NIsfxCeR2eQSgjE/WUii7lA4UdgKnGzFcnP4qu8omXxMxtzuq55v4Kzj4UTA /hkCkTcbBGizHu6PjF9AsIK6RsYo0oKZzXRDuSDtBZ7sAznkdFCsPR/YW7Tp8SEHvvCS Z9ULenGYclO0og5z+eXmTeWXSzi68mTiwNmT0YPE3g3+qk9aVq6Wu+gfvG4qepeLUTQi D48PSmryXkXsVdf22NajeZfX+/FGCTUf1jmVE7dwB1h9uKZvBHteHH9+m8m7HbCbzbE3 q4wLuqktsupWF9Qt64q0wUr6JoVIlidkS4lCvteAWe5yjkVwA96QlYoz2Rxyq77bAHpD N8cA== X-Gm-Message-State: AOAM530tcwyrBHhV7g3lXKKndI8rqVMmvibCyv/Xaybd532yBMHVy6wD m6CvCJvteZ6P1yAzMjxDnKyibmnY0wLfb3bawVM= X-Google-Smtp-Source: ABdhPJyf4MZGzwlOQJCtTd0XgJ/jknlaSPKSViydkbhsCCGGGg7exjwjQ0CzSK/orrhDZbqYYsYBxoe02lgqrzdj26Q= X-Received: by 2002:a19:3f91:: with SMTP id m139mr249676lfa.439.1601288682244; Mon, 28 Sep 2020 03:24:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 28 Sep 2020 12:24:26 +0200 Message-ID: To: Nicolas Grekas Cc: Benjamin Eberlei , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000168e1205b05d1329" Subject: Re: [PHP-DEV] List of attributes From: nikita.ppv@gmail.com (Nikita Popov) --000000000000168e1205b05d1329 Content-Type: text/plain; charset="UTF-8" On Sun, Sep 27, 2020 at 10:23 AM Nicolas Grekas wrote: > Hi Benjamin, hi everyone > > I'm wondering if the syntax that allows for several attributes is really > future-proof when considering nested attributes: > > > *1.* > #[foo] > #[bar] > > VS > > > *2.* > #[foo, bar] > > Add nested attributes to the mix, here are two possible ways: > > > *A.* > #[foo( > #[bar] > )] > > or > > > *B.* > #[foo( > bar > )] > > The A. syntax is consistent with the 1. list. > I feel like syntax B is not desired and could be confusing from a grammar > pov. > BUT in syntax 2., we allow an attribute to be unprefixed (bar), so that > syntax B is consistent with 2. > > Shouldn't we remove syntax 2. in 8.0 and consider it again when nested > attributes are introduced? > > I voted yes for syntax 2. when the attributes were using << >>. I would > vote NO now with the new syntax. > > Nicolas > As far as my understanding goes, if we introduce "nested" attributes, it will be in the form of relaxing constraints on constant expressions, i.e. by allowing you to write #[Attr(new NestedAttr)]. Nikita --000000000000168e1205b05d1329--