| If I make the following calls, e.g.: > (atpos "@@hjk@" 0)
string-ref: index 7 out of range [0, 5] for string: "@@hjk@"
> (atpos "@hjk@" 1)
string-ref: index 6 out of range [0, 4] for string: "@hjk@" atpos from ac.scm is below. This is using DrRacket 5.0.1. Thanks,
-Dave (define (atpos s i)
(cond ((eqv? i (string-length s))
#f)
((eqv? (string-ref s i) #\@)
(if (and (< (+ i 1) (string-length s))
(not (eqv? (string-ref s (+ i 1)) #\@)))
i
(atpos s (+ i 2))))
(#t
(atpos s (+ i 1))))) |