We're planning a major revamp of string and I/O functionality in 0.4, so
this will all very likely change in the near future. Strings will be much
more lightweight and efficient, and SubStrings will be the same as Strings.


On Wed, Jun 11, 2014 at 10:17 AM, Milan Bouchet-Valat <[email protected]>
wrote:

>  Le mercredi 11 juin 2014 à 07:02 -0700, Kevin Squire a écrit :
>
>  Actually, Strings are already immutable. Well, mostly. You can't change a
> string directly, but you can (but generally shouldn't) modify the backing
> array.
>
>
>
>  Given that, I don't know why indexing couldn't return a substring,
> although there might be reasons--e.g., calling C code is possible with
> ASCIIStrings or UTF8Strings, but SubStrings have to be copied and
> null-terminated (I think this already happens).
>
> Yeah, you are supposed to call bytestring() on strings you pass to C. It
> is a no-op for ASCIIString and UTF8String, but not for SubString, for
> which it creates a copy.
>
>
> Regards
>

Reply via email to