Re: Introducing "Array Of" RFC
| From: | Andrea Faulds | Date: | Mon, 20 Jan 2014 19:46:18 +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-71339@lists.php.net to get a copy of this message | ||
On 20/01/14 19:37, Philip Sturgeon wrote:
On Mon, Jan 20, 2014 at 2:24 PM, Andrea Faulds <ajf@ajf.me> wrote:But these *are* generics. If we add "proper generics" in future, Array<int> would keep meaning the same thing, though I suppose we'd need to allow implict casting of Arrays of ints. That's all that'd change. This doesn't block adding proper generics, it adds a weak and limited form of them for arrays only, which could be improved in performance with "proper" generics later if we so wished. -- Andrea Faulds http://ajf.me/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?If we use the generics syntax for not-generics, then we can't EVER implement generics properly, so that would be an incredibly bad idea.