guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: substring


From: Mike Gran
Subject: Re: substring
Date: Fri, 7 Sep 2012 11:05:57 -0700 (PDT)

>  
>Hi,
>
>Why do we need substring [1]? We already have string-copy which looks
>similar to me.
>(These functions take different number of arguments, but string-copy
>can handle this because it's more generic.)

I haven't looked at the code lately, but, it used to be that substring
would allow you to create a string that initially shared the same string
buffer as the string from which it was derived, saving memory.  Later, if
you tried to modify the substring or the parent string, it would
allocate a new string buffer for itself.  But if you never modified the parent
or the substring, they would always point to (presumably different) 
locations in the same string buffer. 
 
-Mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]