Feature request: Path append operators for strings

w0rp devw0rp at gmail.com
Wed Jul 3 14:48:21 PDT 2013


I am strongly against this kind of thing. Operator overloading is 
a very useful tool for providing obvious semantics to types. User 
defined data structures, like a matrix type, can be treated like 
first class citizens, just like built in primitive types, by 
having overloads for relevant operators.

Using an operator to implement something non-obvious is a crime 
to me. Plus, it's usually wrong, because like C++ streams, you'd 
have to have each binary relation take a reference to something 
(like an ostream) and return the reference again so you can chain 
the operators. Why chain several binary function calls together 
when you can have a single n-ary function call like 
std.path.buildPath?

Also to shamelessly self-plug, I made a garbage collected matrix 
type with a few overloads for fun recently. Maybe somebody will 
find a use for it. 
https://github.com/w0rp/dmatrix/blob/master/matrix.d


More information about the Digitalmars-d mailing list