Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110796 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69516 invoked from network); 1 Jul 2020 08:50:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Jul 2020 08:50:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0FBEC1804C2 for ; Wed, 1 Jul 2020 00:39:26 -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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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, 1 Jul 2020 00:39:25 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id n23so25793228ljh.7 for ; Wed, 01 Jul 2020 00:39:25 -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=rtEnQpLylgtOCtow2MwRzDyXTs8dNM7KLjXlwxxF7Vw=; b=FbVDNcv9+vvr3BVf/E+HiYP8JexZ21fQgBGeTDDFnN/5VNwxYRm4mg4lt4+h0ulgbX Tn7tdV6n8Qk6whf8+WSCmvA5iLMHV4ME76rqdL0iS7ho/0RBvUNKt8zqeGyZGlVOBIj8 CttglfJ2WUoWdZ2pX+N6HAlaxTVHeb1dHFNSQEr7QK8xubQqvkbuobCSOxFah4tUBVQv y7u9IJss8ss+zmpwrz5hcCpWgTynTyJvTavYTkylxbfQMqpVAdrPvAvGop5SW0T0POSt qATnisOSoosuxlgDdlwgPAILCg2DfgemqoatxeH+SfSedYxR+RAZWIh7YIb6+21iJFz3 HiTg== 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=rtEnQpLylgtOCtow2MwRzDyXTs8dNM7KLjXlwxxF7Vw=; b=CMuaqp6xatJHnqOnZw3qQl/cGwFKdZbbehbh9/BCcc2nWy+axDFT052B6ucF0Smm3v U1PpYXB6PPTyDudEdfLnFEydpQS///lLiAzS8MG1vsFvq4e+DFHWCwKx793SfOHkSSEr Svtj9Q3VVEGxdZsUP0fSuyt2vOP/V1ZCaKjh1CbiOVvc5rCAc/Tds0Ora8VaUqJnktmW brkBztRn40KdHFjzZN1J59Q3QkxM6aGtNOR+NTXVlofxurhCRQEyyvb//MuOSUHQblWb 8x0+C8wV5zGt1e9syfrrKnbxFoo4WMY8zgyVdAky7zXHtcguYsbFqDBpNXu/O9sRUTfg r3Jg== X-Gm-Message-State: AOAM531hUa9u1u6y49ANV4mpXIR9f2bzfWMk8yVh/+hVSX3GZaEvZSNl zau3e1KwTdQxolueoFYkig5GDgtN3YTsp4WtLfU= X-Google-Smtp-Source: ABdhPJzvR55bBa0RI3vfj/EKyAX0XybunhsASS8V3CaurlMbnjSz6GyWontzDKz/TBMC9f0Bwb5KEhxpqGsVIxctwtM= X-Received: by 2002:a2e:850b:: with SMTP id j11mr12866524lji.30.1593589163260; Wed, 01 Jul 2020 00:39:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 1 Jul 2020 09:39:07 +0200 Message-ID: To: tyson andre Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="000000000000fe7fbb05a95c6356" Subject: Re: [PHP-DEV] Permitting trailing commas in closure use() declarations From: nikita.ppv@gmail.com (Nikita Popov) --000000000000fe7fbb05a95c6356 Content-Type: text/plain; charset="UTF-8" On Wed, Jun 24, 2020 at 5:23 PM tyson andre wrote: > Hi internals, > > https://wiki.php.net/rfc/trailing_comma_in_parameter_list mentioned > > > https://wiki.php.net/rfc/list-syntax-trailing-commas Trailing Commas In > List Syntax was a previous proposal to support optional trailing commas in > all list-like structures. > > > > Nothing has substantially changed since those RFCs in technical terms, > but I think the aforementioned style > for breaking up large parameter > lists has become more accepted in the meantime, and features like > Constructor Property Promotion are going to increase its use further. > > So I'm wondering if anyone's interested in revisiting this: > > - It'd be easy to forget that function parameters support trailing commas, > but not closure uses, especially if you're new to the language. > - Supporting trailing commas in multi-line declarations would make version > control history easier > - if you had a closure for which `fn` wouldn't work (a list of values *and > references* to use, or a list of statements), > it'd be convenient to split it up across multiple lines > > e.g. > > ``` > $incrementing_id = 0; > return \array_map(static function (array $map) use ( > $function, > $some_data_structure, > $some_flag, > &$incrementing_id, > ): ReturnType { > ``` > Sounds reasonable to me. I thought we had already covered all cases that are inside (), but apparently not. I think if there are no objections on list, we can just land this change. Given how positive the outcome of the "trailing comma in parameter lists" RFC was this doesn't seem controversial. Regards, Nikita --000000000000fe7fbb05a95c6356--