1. Moritz Heidkamp
  2. comparse

Commits

Moritz Heidkamp  committed 688c06c

Less unnecessary retention of input seq's head

  • Participants
  • Parent commits 8e7584e
  • Branches master

Comments (0)

Files changed (1)

File comparse.scm

View file
  • Ignore whitespace
 
 (define (parse parser input #!key memoize)
   (parameterize ((memo-table (if memoize (make-hash-table) (memo-table))))
-    (let* ((input (->lazy-seq input))
-           (result (parser (->lazy-seq input))))
+    (let* ((result (parser (->lazy-seq input))))
       (if result
           (values (car result) (cdr result))
-          (values result input)))))
+          (values result (->lazy-seq input))))))
 
 )