Changeset 8311 in project


Ignore:
Timestamp:
02/09/08 22:47:59 (12 years ago)
Author:
Kon Lovett
Message:

Added left & right section to Combinators. Simple but useful.

Location:
chicken/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/buildsvnrevision

    r8281 r8311  
    1 8278
     18310
  • chicken/trunk/extras.scm

    r8281 r8311  
    259259
    260260(define (any? x) #t)
     261
     262(define (left-section proc . args)
     263  (##sys#check-closure proc 'left-section)
     264  (lambda x
     265    (##sys#apply proc (##sys#append args x)) ) )
     266
     267(define right-section
     268  (let ([##sys#reverse reverse])
     269    (lambda (proc . args)
     270      (##sys#check-closure proc 'right-section)
     271      (lambda x
     272        (##sys#apply proc
     273                     (##sys#reverse (##sys#append (##sys#reverse args)
     274                                                  (##sys#reverse x)))) ) ) ) )
    261275
    262276
Note: See TracChangeset for help on using the changeset viewer.