Changeset 14819 in project


Ignore:
Timestamp:
05/28/09 06:49:26 (10 years ago)
Author:
Ivan Raikov
Message:

reorganization of seq

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/lexgen/trunk/lexgen.scm

    r14808 r14819  
    8787(define (seq pats)
    8888  (lambda (streams)
    89     (fold (lambda (f s) (f s)) streams pats)))
    90 
     89    (let loop ((streams streams) (pats pats))
     90      (cond
     91       ((null? pats)  streams)
     92       ((pair? pats)  (let* ((pat      (car pats))
     93                             (streams1 (pat streams)))
     94                        (and streams1 (loop streams1 (cdr pats)))))
     95       (else #f)))))
    9196
    9297;; This matches any of a list of patterns. It's analogous to a series
Note: See TracChangeset for help on using the changeset viewer.