[~OT] Finally, a clear, concise D spec!
Jarrett Billingsley
jarrett.billingsley at gmail.com
Wed Jul 29 06:55:40 PDT 2009
On Wed, Jul 29, 2009 at 9:43 AM, language_fan<foo at bar.com.invalid> wrote:
> Wed, 29 Jul 2009 08:58:32 -0400, Jarrett Billingsley thusly wrote:
>
>> (Of course I find the whole property
>> syntax used for type introspection a bit silly, a half-thought-out
>> feature that's hard to parse, not easily extensible, and which doesn't
>> fit syntactically with the rest of the metaprogramming facilities.)
>
> Maybe it requires a better grasp of the big picture to fully understand
> the nuances involved? After all, a feature like object.stringof is much
> easier to type than the other alternative __traits
> (get_string_presentation_of, object)
Or it's just that Type.property was in the D spec as early as 1999,
and D wasn't initially meant to have metaprogramming, so its various
introspection capabilities are kind of .. organically grown.
__traits is ugly only because W wanted it to be. traits(stringof, x)
is just as easy to type, far easier to parse, and much more consistent
than x.stringof.
More information about the Digitalmars-d
mailing list