Re: Introducing "Array Of" RFC
| From: | Andrea Faulds | Date: | Mon, 20 Jan 2014 19:24:24 +0000 |
| Subject: | Re: Introducing "Array Of" RFC | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-71336@lists.php.net to get a copy of this message | ||
On 20/01/14 19:17, Sara Golemon wrote:
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?This is a quite good point. If we're introducing limited-scope Generics here, what's wrong with using Generics syntax, especially since it will be familiar to C#, C++ and Java users? -- Andrea Faulds http://ajf.me/