Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85301 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52354 invoked from network); 20 Mar 2015 16:09:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2015 16:09:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.175 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.175 mail-wi0-f175.google.com Received: from [209.85.212.175] ([209.85.212.175:35235] helo=mail-wi0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/8B-21731-8364C055 for ; Fri, 20 Mar 2015 11:09:28 -0500 Received: by wibdy8 with SMTP id dy8so21003561wib.0 for ; Fri, 20 Mar 2015 09:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=yd0bD0nmli7vhEsu+xDCWqCpyFgocYYVUUuAXR8jt1E=; b=Tg6QKVOqqqQQ2eTTVHQsw4D5SpKKk+e5qk0Yvs1gDxzP/vVds6J2m8WfLX70Y2KdVF blTEaBA4DdOGRkS9RNjSw59J/CA3L25s/kELwJMtDTLbycsO36fPW0EewEZTwqktL8GJ 3Kjo8Eot5zGSZpBvI9UFvPc/fzHqCXSlbKuI6x7w9giNeX/RPSHRbscYEAmbCgN9sbAo yrSDV8Eek8a9zegS5rc3mx5UmXm7WVyZHAGQsZ4HdzknWivq+DFuX7DIdE+Lql7/9OxJ wcA8HjR3XHP0817YuzCrI5DLbiTL7ky7oKCUD4wY4laTqu2QSxXZPeMOjShBzqiNgf7S Fb6A== X-Received: by 10.180.184.136 with SMTP id eu8mr26023235wic.45.1426867765274; Fri, 20 Mar 2015 09:09:25 -0700 (PDT) Received: from [192.168.0.159] ([62.189.198.114]) by mx.google.com with ESMTPSA id j9sm6952566wjy.18.2015.03.20.09.09.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Mar 2015 09:09:24 -0700 (PDT) Message-ID: <550C4623.1090709@gmail.com> Date: Fri, 20 Mar 2015 16:09:07 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Alex Bowers , Leigh CC: internals@lists.php.net References: <550B5A81.1090706@gmail.com> <550B7189.4040608@gmail.com> <7486C296-7535-4633-AFE2-02E7BBC67BC5@gmail.com> <550C1176.9050307@gmail.com> <550C1AE4.8090607@gmail.com> <550C1EC3.8000106@gmail.com> <550C317E.8020508@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------080405010705000508080504" Subject: Re: [PHP-DEV] RFC - Array slice syntactic sugar From: rowan.collins@gmail.com (Rowan Collins) --------------080405010705000508080504 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Alex Bowers wrote on 20/03/2015 16:00: > > IMHO, stick to offsets in the first instance, this is a slice > notation, first order of business is to make it behave like > array_slice (+on strings). Assoc key based slicing feels pretty > wrong to me at this point. > > > I have to agree, we are getting ahead of ourselves. > > A quick summary of what this RFC should cover: > > - Slicing an array or string based on the positional index. > > Things for future RFC consideration: > > - Slicing an array or string based on the key. > - Index -1 for last item of list. > > Everybody agree that the only focus of this RFC should be the > positional index slicing? I'd be tempted to introduce the ability to get a single element by position as well, just because that would be a really useful feature, and "accessing array elements by their position" is kind of pre-requisite for "accessing a set of array elements by their positions" anyway. It might also make the rationale for the eventual syntax more obvious to those who haven't been reading this conversation. :) Regards, -- Rowan Collins [IMSoP] --------------080405010705000508080504--