On 2012-01-18 14:59, Andrei Alexandrescu wrote:
On 1/18/12 7:20 AM, Steven Schveighoffer wrote:
I think the compiler should not be in the business of generating methods
or properties that could be trivially handled by the library.
Yes. I'm fighting Walter tooth and nail over that, with pale success.
The only array-specific properties of an array that the compiler should
worry about are ptr and length. Everything else should be a library
function.
Even ptr and length should be in the library. The slice structure should
be defined in object.d. The only business the compiler has is to lower
the T[] type syntax and the [ ... ] literal syntax to .object.Slice!T
and .object.slice(...) form, and to make sure that typeof(T[]) is not
struct (although factually it is).
Andrei
But a library can't handle common properties like "mangleof" and "stringof"?
--
/Jacob Carlborg