Re: Introducing "Array Of" RFC
| From: | Stas Malyshev | Date: | Mon, 20 Jan 2014 20:54:45 +0000 |
| Subject: | Re: Introducing "Array Of" RFC | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-71349@lists.php.net to get a copy of this message | ||
Hi!
> ArrayOf: "I would like hammers in a bag."
> Generics: "I would like a bag of hammers."
Generics are more like "I would like a 100lb to 120lb bag of hammers
with handles made of wood grown in equatorial Africa between 1980 and
1985, not cut down during national holidays in Brazil and provided all
workers were paid the fair wage, while the heads must be made of steel
approved by German Council of Steel Manufacturers, and the assembly must
have been performed in a country that signed the convention about the
ethical treatment of animals". You'd want arrays of arrays of foo, and
arrays that have keys of foo and values be arrays of tuples of bar and
baz, etc. etc.
I can definitely see a contract that would require hammers exactly like
that, or even with more precise list of conditions, but do we want this
in the PHP language itself (as opposed to delegating it to the
user/library code)? I personally don't really want it as a part of the
language. I think keeping language small(ish) and simple has its value.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227