Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71341 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17571 invoked from network); 20 Jan 2014 20:17:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jan 2014 20:17:31 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.160.50 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.160.50 mail-pb0-f50.google.com Received: from [209.85.160.50] ([209.85.160.50:62490] helo=mail-pb0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 89/46-02192-B5E7DD25 for ; Mon, 20 Jan 2014 14:51:56 -0500 Received: by mail-pb0-f50.google.com with SMTP id rq2so7376021pbb.23 for ; Mon, 20 Jan 2014 11:51:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=DU69EjAM9ehAirKUhbtLt++jMH9rTGqmdGcuGjNyejo=; b=iRhbkr1FmML6NnFXAW/UKZBHmFZZRuWYkZkRfZc4dD8ajJkiuCYqxI3QtZDr/VM5JE vkzYAlGHE35Sj5x+v5b6h0aoJZYuJ++iNIHVJPYckqMGKmS+WFgSD9n82iscVIJxJbq9 Zq3RFrjjwSuNQqtRjE3R/EM5j5qFgAJTH3OiDFZsLeapKKoHa8mcd1hYtb+hWAU2u+2Y xCvyKgnCC4X+9vObEIHlML6PwFGi3ntwTNkebrs/NkwHeFBH64chn1T7AANqKZgbVCT1 1buLfSQghYfvD7JcHlWJlxQ5EeDFvQR1pqYR+49hx7boJwtdWM30pbknKbsaLmkQY88F UlVw== X-Gm-Message-State: ALoCoQmksLrIRZQWIDSd+7ddCj6DeEf5qDCsRs7aEC4tstjFHfTXHzxrhFYEvbPyk5KdgTp1P5iM MIME-Version: 1.0 X-Received: by 10.68.192.131 with SMTP id hg3mr5198974pbc.136.1390247513372; Mon, 20 Jan 2014 11:51:53 -0800 (PST) Sender: php@golemon.com Received: by 10.70.77.164 with HTTP; Mon, 20 Jan 2014 11:51:53 -0800 (PST) X-Originating-IP: [2001:470:1f09:2fa:22c9:d0ff:fe87:295b] In-Reply-To: References: <002d01cf1234$01e6dc60$05b49520$@tutteli.ch> <004c01cf123d$35730870$a0591950$@tutteli.ch> <52D71748.1090402@googlemail.com> <52D71FAE.8030002@ajf.me> <005001cf124f$3a40df00$aec29d00$@tutteli.ch> <20140116110127.202079vzjsj76n7b@webmail.tutteli.ch> <0B.B1.24763.139B7D25@pb1.pair.com> <002001cf12da$2bfbda90$83f38fb0$@tutteli.ch> <52DCA3E7.80602@lerdorf.com> <52DCED71.3020207@pthreads.org> <006301cf15f5$22f8df60$68ea9e20$@tutteli.ch> Date: Mon, 20 Jan 2014 11:51:53 -0800 X-Google-Sender-Auth: iwUU1j7ILI1xiPPGIB-XhTVAGYg Message-ID: To: Philip Sturgeon Cc: Philip Sturgeon , Robert Stoll , Joe Watkins , "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Introducing "Array Of" RFC From: pollita@php.net (Sara Golemon) > Why should this RFC get put on hold forever because people cannot come > to an agreement about scalar type hints? Why would it be better, > quicker, or easier this time? :) > It shouldn't, by any measure. I'm just saying that ignoring scalars doesn't buy us anything in understanding how typed array hints are useful. The topic is argument type hinting, scalars are a component of that, even if not an essential component of this RFC. >> ArrayOf is not a separate topic from Generics, it is by definition a >> narrowly-scoped form of generics. "ArrayOf Foo" is a "Foo" >> specialization of the array generic (even if it's not labeled as such >> due to not having other types of generics). "This is an array, but >> it's an array just for Foos". Can arrayof be implemented in a way >> which hides this heritage? Sure, but should it? > > I respectfully but strongly disagree. > > This feature: "I would like a bag of spanners" > > Generics: "I would like a **polyester** bag full of spanners, and this > is how you should put those spanners into that bag." > I respectfully by strongly disagree. ArrayOf: "I would like hammers in a bag." Generics: "I would like a bag of hammers." > Pros > ----- > > You can be very certain what you are putting in there > It's a little quicker than checking an array of content > > Cons > ----- > > Definitely "forcing OOP on people" > Require the user to do stuff outside of the method declaration that > they dont care about > It's a whole new topic, instead of a simple improvement. > These arguments apply to broadly-scoped Generics, but not to the specifics of presenting arrays as a generics specialization. It does not enforce OOP on anyone. It does not require anyone to do anything outside of the method declaration. I'm sorry, but those arguments are simply untrue. > I know you'd like to see generics in PHP, and while I personally don't > care too much about them you have support from Joe and others. It > would be great of generics could be done, but this is not generics. > This is "I want an array of Foo", which soon will be "I want an array > of integers". I hope to god we don't suggest that people create a > generic to ask for an array of co-odinates. > I agree, and I'm not asking for Generics. Honestly, I'm not even too bothered whether we see generics or not, so don't tell me what my opinions are. I'm including a discussion of generics in my comments on ArrayOf because of their clear overlap. I'm sorry you can't see that. >> Ignoring elements which fit closely together is a short-sighted mistake. >> > And trying to bundle things in together which seem to vaguely overlap > is a very quick way to get stuck in the mud. :) > Yes, but that has nothing to do with the topic at hand since they fit so well together. I can't imagine why you included such a nonsequiter... -Sara