[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATH] fix for srfi-13 string-trim-right start par
From: |
John Cowan |
Subject: |
Re: [Chicken-hackers] [PATH] fix for srfi-13 string-trim-right start parameter |
Date: |
Wed, 22 Jan 2014 20:58:05 -0500 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Mario Domenech Goulart scripsit:
> Quoting Taylor Campbell (from #scheme):
>
> So, just to be clear: the right fix is to replace `0' by `start'
> in the definition of STRING-TRIM-RIGHT. (Taking the minimum of
> the start and (+ 1 i) is also correct but unnecessary, because
> STRING-SKIP-RIGHT guarantees (<= start i).)
Yes, he's right, but that exposes another bug:
(string-skip-right "abc " char-whitespace? 4 4) => 2
The correct result is #f; Riastradh confirmed that the correct semantics
throughout SRFI 13 for start-end is that they are conceptually applied
using substring/shared before anything else is done.
A quick look at the reference implementation suggests that it needs
to trap the case where start = end, and always return #f then.
Causing start > end to throw an error wouldn't hurt either.
--
XQuery Blueberry DOM John Cowan
Entity parser dot-com address@hidden
Abstract schemata http://www.ccil.org/~cowan
XPointer errata
Infoset Unicode BOM --Richard Tobin
- Re: [Chicken-hackers] [PATCH] fix for srfi-13 string-trim-right start parameter, (continued)
Re: [Chicken-hackers] [PATH] fix for srfi-13 string-trim-right start parameter, .alyn.post., 2014/01/11
Re: [Chicken-hackers] [PATH] fix for srfi-13 string-trim-right start parameter, Mario Domenech Goulart, 2014/01/11
Re: [Chicken-hackers] [PATH] fix for srfi-13 string-trim-right start parameter, Mario Domenech Goulart, 2014/01/19
Re: [Chicken-hackers] [PATH] fix for srfi-13 string-trim-right start parameter,
John Cowan <=
Re: [Chicken-hackers] [PATH] fix for srfi-13 string-trim-right start parameter, Alex Shinn, 2014/01/22
[Chicken-hackers] Bug in SRFI 13 string-skip-right (was: fix for string-trim-right), John Cowan, 2014/01/22
Re: [Chicken-hackers] Bug in SRFI 13 string-skip-right (was: fix for string-trim-right), Alex Shinn, 2014/01/23
Re: [Chicken-hackers] [PATH] fix for srfi-13 string-trim-right start parameter, Mario Domenech Goulart, 2014/01/19