Re: Substring indices everywhere? Eating a cake without destroying it Per Bothner 31 Dec 1999 22:36 UTC

xxxxxx@pobox.com writes:

> What exactly is the XS>< form? It's up to an implementation. One
> Scheme system may choose to implement (XS>< str ind1 ind2) as
> (substring str ind1 ind2). This is the easiest (albeit not very
> efficient) approach.  In this case, (XS>< str ind1 ind2) is a real
> string, so we can use R5RS string->number, string=?, etc. procedures
> as they are.

Why not just allow an implementation to "inline" substring?
Instead of:
        (string->number (XS>< "$12345.99" 1))
the programmer would write:
        (string->number (substring "$12345.99" 1))
and the implementation can re-write this as:
        (%%substring->number "$12345.99" 1)
--
	--Per Bothner
xxxxxx@bothner.com   http://www.bothner.com/~per/