4 ms·
Presumably it would require magic to handle foo + " " + bar
by DougBTX 17y ago
Presumably it would require magic to handle
foo + " " + bar
- stcredzero 17y agoIf foo contains an instance TrimmedString, why can't it just return itself after the first + operation? If you send a TrimmedString to a String, then all bets are off. This would make the use case: if you start with a TrimmedString, you always have a TrimmedString. (Barring operations that are deliberate conversions.)
- shrughes 17y agoBecause if foo contains "f" and bar contains "b", then your scheme would have (foo + " " + bar) contain "fb" and not "f b"
- stcredzero 17y agoThen the fool should use a regular String! RTFM!
- jongraehl 17y agono problem - types for left-trimmed, right-trimmed, and both-trimmed ;)