Re: Introducing "Array Of" RFC
> Short version: "This RFC is not about Scalar Type Hints or Generics"
>
But it is.
"ArrayOf", whatever form it takes, is incomplete without scalar
specializations. Is implementing half-a-feature (arrayof without
scalars) good enough? Maybe, but that doesn't mean we shouldn't be
having that discussion.
> There have been a lot of people suggesting various types of syntax. As
> Joe said, using generics syntax for not generics would be a travesty,
> and an overcomplication of what should be a simple feature.
>
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'd really like it if we could discuss just this feature, and keep the
> generics, OOP arguments, anti-type-checking, and "bemoaning of
> edge-case performance issues on type system that needs some love
> anyway" conversations for other threads.
>
Just reinforce my points above, I disagree with this paragraph.
Looking at specific cases while ignoring the larger picture of the
language's design is what gets us into ugly corners (inconsistently
named functions, parameter ordering, multiple autoloader mechanisms,
etc...)
Ignoring elements which fit closely together is a short-sighted mistake.
-Sara
Thread (73 messages)