Changeset 9587 in project


Ignore:
Timestamp:
03/14/08 02:15:54 (12 years ago)
Author:
Kon Lovett
Message:

Docu for new combinators (where did the originals go?) & minor optimization to right-section.

Location:
chicken/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/extras.scm

    r9524 r9587  
    255255(define (left-section proc . args)
    256256  (##sys#check-closure proc 'left-section)
    257   (lambda x
    258     (##sys#apply proc (##sys#append args x)) ) )
     257  (lambda xs
     258    (##sys#apply proc (##sys#append args xs)) ) )
    259259
    260260(define right-section
     
    262262    (lambda (proc . args)
    263263      (##sys#check-closure proc 'right-section)
    264       (lambda x
    265         (##sys#apply proc
    266                      (##sys#reverse (##sys#append (##sys#reverse args)
    267                                                   (##sys#reverse x)))) ) ) ) )
     264      (let ([revdargs (##sys#reverse args)])
     265        (lambda xs
     266          (##sys#apply proc (##sys#reverse (##sys#append revdargs (##sys#reverse xs)))) ) ) ) ) )
    268267
    269268
  • chicken/trunk/manual/Unit extras

    r9418 r9587  
    706706
    707707
     708==== none?
     709
     710 [procedure] (none? X)
     711
     712Ignores its argument and always returns {{#f}}. This is actually useful sometimes.
     713
     714
     715==== always?
     716
     717 [procedure] (always? ...)
     718
     719Ignores its arguments and always returns {{#t}}. This is actually useful sometimes.
     720
     721
     722==== never?
     723
     724 [procedure] (never? ...)
     725
     726Ignores its arguments and always returns {{#f}}. This is actually useful sometimes.
     727
     728
    708729==== constantly
    709730
     
    769790
    770791
    771 
    772792==== each
    773793
     
    845865A single value version of {{compose}} (slightly faster). {{(o)}} is equivalent
    846866to {{identity}}.
     867
     868
     869==== left-section
     870
     871 [procedure] (left-section PROC ARG0 ...)
     872
     873Returns an n-ary procedure that partially applies its' arguments {{ARG0 ...}}
     874from the left (normal order). Sort of a n-ary curry.
     875
     876
     877==== right-section
     878
     879 [procedure] (right-section PROC ARG0 ...)
     880
     881Returns an n-ary procedure that partially applies its' arguments {{ARG0 ...}}
     882from the right (reverse order). Sort of a n-ary curry.
     883
    847884
    848885=== Binary searching
Note: See TracChangeset for help on using the changeset viewer.