Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101671 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81943 invoked from network); 25 Jan 2018 20:10:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jan 2018 20:10:37 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.178 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.128.178 mail-wr0-f178.google.com Received: from [209.85.128.178] ([209.85.128.178:44186] helo=mail-wr0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/43-61119-CB93A6A5 for ; Thu, 25 Jan 2018 15:10:37 -0500 Received: by mail-wr0-f178.google.com with SMTP id v31so3530032wrc.11 for ; Thu, 25 Jan 2018 12:10:36 -0800 (PST) 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=0slpNYIa9Pu+cAkMQUGs4xr4nAtvezef2iZYOE1zsgA=; b=pZI3gMWfaim3Y0/M8qqYr7zWjJ1ljdu1HUrYAL6cS1wiikrEKq3C6Jys9SBK3h08dP roud0XqChXUl//lBIyWFONUhfudNd4i7/KH+YspHF74/oFAYsVxhK1jrjkOuQ0nDSzN8 R4Xal8cSoIgu9vRM1zxGCXS0bQ3jbZsARRC8P3Yfc8kBpcminYevWjfKFzhyp3XMUYX4 P3p5A3Omso4FTvehr/p0X67HrVj9N1DUM/aXSw2lvqrUy+ouZ8aw68ee1SpZ4sMjfaoN 379SfeP84UPV3A5ywqnD5fLgMbulzOGTwSLbaYGzGwcBrZ+sVDxWU1UHo36MwqNbhpPA H+dw== 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=0slpNYIa9Pu+cAkMQUGs4xr4nAtvezef2iZYOE1zsgA=; b=VOYD6cZ7sFPMTnsKAn58I4GbHMDMbyetOGODms4DnYl3INZIFNsBJEkW+bE/7YLdtS KWeYZgZGZ0sPG9xm269nP5/1hEmBjB2UBFC8Zb4uPly75riTMwqMyQAkKDxuGSre4EE7 dHrqcLicEsPowpwlQ56fJh0HdI7Sf19XXXo4dfV4mEvbhfx4Qo17QSGWT4wwowVy+W/P nA7U1vRjrLMQewwZ0AX00Vqcxv0BUK3JR3y24mtxR+NsqW7qDqZ1kZJ6r2IF3GrwNn/d GUGb6WYWzVwE6WC8alxlvRnBsq8Xz3d1jtbyb0Mhd+Y54Cu69YgAVRsqRQGCvNebpfxe eeYg== X-Gm-Message-State: AKwxytcZ6vzXcabWCyYGXozZ3/BMNy5F4FXiSfI/hdUQMe/6+yeBQOiL KhWASUTDqPHJYFtWIEbE9JLK9Q== X-Google-Smtp-Source: AH8x226v3F5YVe4U7Yt2ZlTipq2j6IAAUlQ4xObskrSGBdeso8bBkMhfgMGimHUx5nnywaw19y4XhQ== X-Received: by 10.223.128.110 with SMTP id 101mr9820115wrk.177.1516911033834; Thu, 25 Jan 2018 12:10:33 -0800 (PST) Received: from [192.168.1.253] (host86-173-114-42.range86-173.btcentralplus.com. [86.173.114.42]) by smtp.googlemail.com with ESMTPSA id h200sm2317310wme.11.2018.01.25.12.10.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 12:10:32 -0800 (PST) To: internals@lists.php.net References: Message-ID: <9b12b0e2-185e-86fb-0e0b-c4f24bfbd661@gmail.com> Date: Thu, 25 Jan 2018 20:10:27 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV][RFC][DISCUSSION] Collection Inspection From: rowan.collins@gmail.com (Rowan Collins) On 25/01/2018 14:52, Derick Rethans wrote: > IMO, it makes a lot more sense to check integrity when creating the > "array" structure. Instead, I would suggest to add a native Collection > type, that takes a "type" as argument. They aren't quite full generics, > but it does 1. fix something; 2. isn't really complicated. > > What I am suggesting is to add a new syntax "Collection<$type>", > mimicking a class, but having a type as "argument": > > $a = new Collection; So would I be right in thinking this would mean adding basic support for generics to the engine, but not letting new ones be defined in userland? So, a bit like how internal or extension classes have the ability to do more overloading of casts and operators than userland classes? If so, I like the concept, but wonder whether the parts of the implementation it would need are the easy parts of the hard ones. I guess not being able to inherit from the generic would get rid of a bunch of complexity, but don't really know where else the challenge lies. Regards, -- Rowan Collins [IMSoP]