On Fri, 2012-09-07 at 21:49 +0400, . wrote: > 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.) > > Is this connected with compatability, convenience or something else? > > [1] > http://www.gnu.org/software/guile/manual/html_node/String-Selection.html#String-Selection >
*string-copy is actually substring/copy, which is a newly allocated string buffer. *substring is a copy-on-write version. *substring/shared is actually the same string buffer with the original string. It won't do any copy operation. > Thanks >