Re: string to string conversions
Per Bothner 26 Feb 2020 16:37 UTC
On 2/26/20 7:04 AM, John Cowan wrote:
> I read over SRFI 140 again, and was surprised to notice this time that there are no string->istring and string->mstring conversions. String-repeat with a count of 1 can accomplish the first, and string-copy can accomplish the second, but they aren't exactly obvious.
This was touched on in the discussion, and I think there were explicit conversions
in early drafts.
https://srfi-email.schemers.org/srfi-140/msg/4001141/
https://srfi-email.schemers.org/srfi-140/msg/4059609/
One can of course add string->mstring as a synonym for (1-argument) string-copy, but it's not clear
to be that would be better.
string->istring can be expressed using substring as well as string-repeat.
I'm ambivalent about adding an explicit string->istring - I'm not opposed.
At the very least "Conversions" section should explicitly mention (as a post-finalization
editorial change?) the recommended idioms for converting to istring or mstring.
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/