Changes between Version 17 and Version 18 of CombinatorsCowan


Ignore:
Timestamp:
08/27/17 12:48:48 (4 weeks ago)
Author:
cowan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CombinatorsCowan

    v17 v18  
    1 This proposal contains various procedures that return procedures, as well as a few others, drawn from an earlier version of Chicken.  Common Lisp has a few of them too, and more come from [http://programmingpraxis.com/contents/standard-prelude/ the Standard Prelude from ''Programming Praxis'']. 
     1This proposal contains various procedures that accept and return procedures, as well as a few others, drawn from an earlier version of Chicken.  Common Lisp has a few of them too, and more come from [http://programmingpraxis.com/contents/standard-prelude/ the Standard Prelude from ''Programming Praxis'']. 
    22 
    33 
    44== Combinators == 
    55 
    6 These procedures are documented in an unusual style.  Rather than showing only how the procedures themselves are invoked, it also shows how the returned procedures would be invoked.  This is done in order to make the descriptions easier to understand.  For example, if `complement` were documented in the standard style, the description would say "Returns a procedure which, when applied to an argument, returns `#t` when ''proc'' would return `#f` when applied to the same argument, and `#f` otherwise", which is more convoluted. 
     6These procedures are documented in an unusual style.  Rather than showing only how the procedures themselves are invoked, it also shows how the returned procedures would be invoked.  This is done in order to make the descriptions easier to understand.  For example, if `complement` were documented in the standard style, the description would say "Returns a procedure which, when applied to an argument, returns `#t` when ''proc'' would return `#f` when applied to the same argument, and `#f` otherwise", which is more convoluted and harder to understand.  However, this is merely a documentation style; it would be pointless to actually invoke these procedures in this fashion. 
    77 
    88`((constantly `''obj'' ...`)` ''arg'' ...`)` 
     
    2626Invokes `(`''proc obj,,2,, obj,,1,,''`)`. 
    2727 
     28`((flip `''proc''`)` ''arg1 arg2''`)` 
     29 
     30Returns `(`''proc arg2 arg1''`)`. 
     31 
    2832`((fst `''proc''`)` ''obj,,1,, obj,,2,,''`)` 
    2933 
     
    4246Returns `#t` if the ''args'' satisfy any of the ''predicate''s. 
    4347 
    44 `((each `''proc'' ... `)` ''arg'' ...`)` 
     48`((each-of `''proc'' ... `)` ''arg'' ...`)` 
    4549 
    4650Applies each of the ''proc''s in turn to ''args'', discarding the results and returning an unspecified value. 
    47  
    48 `((flip `''proc''`)` ''arg1 arg2''`)` 
    49  
    50 Returns `(`''proc arg2 arg1''`)`. 
    5151 
    5252`((all-of? `''predicate''`)`