Thoughts on versioning
Steven Schveighoffer
schveiguy at gmail.com
Wed Oct 27 17:04:25 UTC 2021
On 10/27/21 12:33 PM, H. S. Teoh wrote:
> On Wed, Oct 27, 2021 at 03:06:10PM +0000, Adam D Ruppe via Digitalmars-d wrote:
>> On Wednesday, 27 October 2021 at 14:51:06 UTC, Steven Schveighoffer wrote:
>>> There is literally no way to reproduce the abomination known as an
>>> autodecoding for backwards compatibility. I tried.
>>
>> in that case realistically you can't make a v2 act sane to strings
>> when built on v1 either, meaning the only choice is to rewrite (aka
>> copy/paste aka fork) as needed.
>>
>> I'm ok with that.
>
> Couldn't we just do something like this?
>
> // Phobos v1
> auto someStringFunc(R)(R range)
> {
> static if (willAutoDecode!R) {
> // old v1 code here
> } else {
> // thin wrapper over v2 code
> }
> }
I'm not seeing the point. Why wrap v2 code when you are going to have to
maintain the v1 code anyway?
Plus, now it's a template that accepts ranges. Like it or not,
`someStringFunc(string)` is not the same as `someStringFunc(R)(R)`.
-Steve
More information about the Digitalmars-d
mailing list