Ticket #58: ssax.diff

File ssax.diff, 1.1 KB (added by sjamaan, 12 years ago)

Patch that is better for maintainability

  • SSAX.scm

     
    627627     (else
    628628      (loop (cdr alist) (cons (car alist) scanned))))))
    629629
     630; From SRFI-1
     631(define (fold-right kons knil lis1)
     632    (let recur ((lis lis1))
     633       (if (null? lis) knil
     634            (let ((head (car lis)))
     635              (kons head (recur (cdr lis)))))))
    630636
     637; Left fold combinator for a single list
     638(define (fold kons knil lis1)
     639  (let lp ((lis lis1) (ans knil))
     640    (if (null? lis) ans
     641      (lp (cdr lis) (kons (car lis) ans)))))
     642
     643
     644
    631645;========================================================================
    632646;               Lower-level parsers and scanners
    633647;
  • ssax-chicken.scm

     
    11;========================================================================
    22;               Highest-level parsers: XML to SXML
    33
    4 (require-library input-parse srfi-1 srfi-13)
     4(require-library input-parse (except srfi-1 fold fold-right) srfi-13)
    55
    66(module ssax
    77