From: Chris Hanson Date: Sat, 4 Mar 2017 08:32:32 +0000 (-0800) Subject: Move substring? to be near its relatives. X-Git-Tag: mit-scheme-pucked-9.2.12~196^2~16 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c6399b4c43b15b5c20dd38e9c83758f006bebd93;p=mit-scheme.git Move substring? to be near its relatives. --- diff --git a/src/runtime/ustring.scm b/src/runtime/ustring.scm index a71dadc86..85e3aba56 100644 --- a/src/runtime/ustring.scm +++ b/src/runtime/ustring.scm @@ -962,6 +962,11 @@ USA. (string-matcher 'string-search-all %dumb-string-search-all)) +(define (substring? pattern text) + (and (or (fix:= 0 (string-length pattern)) + (string-search-forward pattern text)) + #t)) + (define (%dumb-string-search-forward pattern pend text tstart tlast) (let find-match ((tindex tstart)) (and (fix:<= tindex tlast) @@ -1467,11 +1472,6 @@ USA. (define substring-find-previous-char-in-set (substring-find-maker string-find-previous-char-in-set)) - -(define (substring? pattern text) - (and (or (fix:= 0 (string-length pattern)) - (string-search-forward pattern text)) - #t)) (define (string-move! string1 string2 start2) (string-copy! string2 start2 string1))