diff options
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/match.tl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/share/txr/stdlib/match.tl b/share/txr/stdlib/match.tl index 64f53357..0c10dfb1 100644 --- a/share/txr/stdlib/match.tl +++ b/share/txr/stdlib/match.tl @@ -907,9 +907,8 @@ ;; `@{var}txt` (new binding) (((@(eq 'sys:var) @sym) @(stringp @txt) . @rest) (with-gensyms (len end npos) - (list* ^@(require @(with ,len (search-str ,str ,txt ,pos)) - ,len) - ^@(with ,end (+ ,pos ,len)) + (list* ^@(require @(with ,end (search-str ,str ,txt ,pos)) + ,end) ^@(with ,npos (+ ,end ,(len txt))) ^@(with ,sym (sub-str ,str ,pos ,end)) (quasi-match vlist (cdr rest) (cons sym vars) @@ -918,11 +917,10 @@ (((@(eq 'sys:var) @sym) (@(eq 'sys:var) @(bound-p vlist vars @bsym) . @mods) . @rest) - (with-gensyms (txt len end npos) + (with-gensyms (txt end npos) (list* ^@(with ,txt (sys:quasi ,(cadr args))) - ^@(require @(with ,len (search-str ,str ,txt ,pos)) - ,len) - ^@(with ,end (+ ,pos ,len)) + ^@(require @(with ,end (search-str ,str ,txt ,pos)) + ,end) ^@(with ,npos (+ ,end (len ,txt))) ^@(with ,sym (sub-str ,str ,pos ,end)) (quasi-match vlist (cdr rest) (cons sym vars) |