Re: [Scheme-reports] is there a difference between substring and string-copy? Per Bothner (12 Nov 2012 16:33 UTC)

Re: [Scheme-reports] is there a difference between substring and string-copy? Per Bothner 12 Nov 2012 16:29 UTC

On 11/11/2012 10:52 PM, Alex Shinn wrote:
> On Mon, Nov 12, 2012 at 3:43 PM, Per Bothner <per@bothner.com
> <mailto:per@bothner.com>> wrote:
>
>     Is there any difference between
>         (substring string start end)
>     and
>         (string-copy string start end)
>
>     I think it's ok to have both - the former for
>     historical reasons (compatibility) and the latter
>     for regularity.  But if so, perhaps there should be
>     a note to that effect.
>
>
> There's no difference in this example.  Note that
> substring requires the start/end parameters whereas
> for string-copy they are optional.

Right, but I think that requires a comment, otherwise
people might be confused why both are there.  Perhaps
add something like the following to the description
of substring:

   This is equivalent to (string-copy string start end),
   but is provided for backward compatibility and
   stylistic flexibility.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports