Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90689 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57536 invoked from network); 18 Jan 2016 04:54:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jan 2016 04:54:28 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.178 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.214.178 mail-ob0-f178.google.com Received: from [209.85.214.178] ([209.85.214.178:33925] helo=mail-ob0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 82/75-20254-2007C965 for ; Sun, 17 Jan 2016 23:54:27 -0500 Received: by mail-ob0-f178.google.com with SMTP id vt7so153694506obb.1 for ; Sun, 17 Jan 2016 20:54:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=XJqnqzIw0sZHjU7VzLxRzFaZkhgK3+7uuzJIpQWUd8k=; b=PZVRqQmpOXeY+FuGOy8510ZRUa+WZodD5O6pyV3a4SM3DzVO0yuoYXDaVaH1tKD+ju EVRhIEgQWDmgnjeKn5sbzGxE8VHlFDXzwyYqqg2j64+afgPRob5l0QOtLWq6UO4i7hAi YjUHupnXk0CQrpGXCDJPqexAh3TgO/lXmN3Fl5HGCsVfGUdxaJqkwOXQgWwOpVYJbicR hqCPIym4BKKDhwg+lNrH42LJhR3wl4uVbmkT7UKoptRg57Bt6994c/EDzXGtMep1s3bt 65MQGVM+1XzvLuVB62VfBhlemPz4afniJ6iH5RUFETmypnQ6GQFHJaVOlL84AAzKiJvZ zcUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=XJqnqzIw0sZHjU7VzLxRzFaZkhgK3+7uuzJIpQWUd8k=; b=bLs+a9pm/4WkRoQmUpmnSBUNps2rzFbBSX4wPyB5A/fwbHPw8ib6+6AFweDO9Cbj4b oRFISB4f3WLXWuZ7a/2Frif3oWPZLoDcwMSj5EoYXY/n/WcUWqbml4mV+de35nQ4LhOl b6GAw64qIZ0ynbostMHBzGT1My6Nzt66wmKNergzsqKjGg5xvCIfA0LovocjVSPhMptH IMSMfzloQzD5XHcQh4FRDhQbPn8V7+bHdfjSGD5lr13j1H+cUcAz0QSdMzrbl0QVMCo1 1Dz/J2Lwa5Kw+L65EbY2mX3AfrOx4JAgkO8Weu6u22HPMLtuAfCjU/ZYRdYMrEak39m0 XjnQ== X-Gm-Message-State: ALoCoQn6U9jNGrRpxBnKTvwpFlohvQA4NXGmY+Ed66dPdr1ca6/t60yRe6xRJG3FRm9RLCfA0jibIRo+UqY7hTEmKiYp0DWvEg== MIME-Version: 1.0 X-Received: by 10.60.93.170 with SMTP id cv10mr17184147oeb.38.1453092864402; Sun, 17 Jan 2016 20:54:24 -0800 (PST) Received: by 10.202.95.68 with HTTP; Sun, 17 Jan 2016 20:54:24 -0800 (PST) In-Reply-To: References: <3B.E6.32157.D3DFA965@pb1.pair.com> Date: Mon, 18 Jan 2016 11:54:24 +0700 Message-ID: To: Andrea Faulds Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Allow specifying keys in list() From: pierre.php@gmail.com (Pierre Joye) hi Andrea, I very much like this proposal. Good work as usual! The only part where I think we should not rely on list is the future scope. I can see the logic that leads to use list for named arguments. However I really think it is a very different topic and having to use list to define arguments, it sounds like a hack to solve another long due feature. Anyway, as it is not part of this RFC, I will ignore it for now :) Keep the good work, Cheers, Pierre On Mon, Jan 18, 2016 at 9:07 AM, Andrea Faulds wrote: > Hi Bishop, > > > Bishop Bettini wrote: >> >> On Sat, Jan 16, 2016 at 9:32 PM, Andrea Faulds wrote: >> >>> Hi everyone, >>> >>> Here's an RFC that would extend the syntax of list() to be more useful >>> with associative arrays: >>> >>> https://wiki.php.net/rfc/list_keys >>> >>> Please read it and tell me your thoughts. >>> >> >> Nice, Andrea, thanks! Destructuring is quite handy. >> >> I wonder if there is opportunity to include array gathering. Something >> along the lines of: >> >> list ('foo' => $foo, ...$rest) = [ 'foo' => 1, 'bar' => 2, 'baz' => 3]; >> assert $foo === 1; >> assert $rest === [ 'bar' => 2, 'baz' => 3]; >> >> What do you think? > > > That might be useful, and it's certainly intuitive. In languages with linked > lists like Haskell, you can pattern-match the rest of a list, so there's a > precedent. Though with linked lists it's an O(1) operation, while this is > O(n). > > I don't think that should go into this RFC specifically, though, but it > could be a future enhancement. > > > Thanks! > -- > Andrea Faulds > https://ajf.me/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Pierre @pierrejoye | http://www.libgd.org