DIP 1027--String Interpolation--Final Review Discussion Thread
Tove
tove at fransson.se
Sun Feb 2 16:18:41 UTC 2020
On Sunday, 2 February 2020 at 16:10:49 UTC, MoonlightSentinel
wrote:
> On Sunday, 2 February 2020 at 15:31:46 UTC, Tove wrote:
>> Implict conversion to string would trigger allocations! This
>> is not an option, allocations has to be explict. However alias
>> this to tuple is fine by me.
>
> The GC is usually opt-in. Having this in feature in @gc code
> would be better than not having it at all.
It's perfectly fine to have a explicit conversion to string, but
it needs to be clearly visible from the code where all expensive
operations are.
It's the same design philosophy as with the 'in' operator, you
shouldn't use 'in' with O(n) algos, because it looks like a
deceptively cheap operation.
More information about the Digitalmars-d
mailing list