Potential abuse of .stringof

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 9 23:54:26 PDT 2015


On 2015-06-10 02:50, Andrei Alexandrescu wrote:

> An effective solution is to specify .stringof to return types that are
> valid D types (i.e. can be pasted in D code and aliased to identifiers).
> Exceptions: Voldemort types and function types.

Is that enough? The original problem I had, and the reason for my 
comment on GitHub, was that I had used .stringof on a member of .tupleof 
to get the name of an instance variable. Originally .stringof returned a 
string containing both the name of the type and the name of the instance 
variable. Then in some release it was change to return just the name of 
the instance variable.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list