Changeset 14209 in project


Ignore:
Timestamp:
04/09/09 16:39:53 (11 years ago)
Author:
Kon Lovett
Message:

Release.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/amb

    r14119 r14209  
    33== amb
    44
     5The Non-Deterministic Backtracking Ambivalence Operator
     6
    57[[toc:]]
    68
    79
    810== Documentation
    9 
    10 The non-deterministic backtracking ambivalence operator
    1111
    1212The {{amb}} operator is a nice toy and sometimes a useful tool for
     
    1818=== amb
    1919
    20 <macro>(amb EXPR...) => TOP</macro>
    21 
    22 In the form {{(amb)}} the expression always fails.
     20<syntax>(amb EXPRESSION...) => TOP</syntax>
    2321
    2422If the expression has any parameters, the first one of them is evaluated and
     
    2826if at all possible.
    2927
     28The form {{(amb)}} always fails.
     29
    3030=== amb/random
    3131
    32 <macro>(amb/random EXPR...) => TOP</macro>
     32<syntax>(amb/random EXPRESSION...) => TOP</syntax>
    3333
    3434Works like {{amb}} but the parameters are not selected in sequence but
     
    3737=== amb-find
    3838
    39 <macro>(amb-find EXPR [FAILURE-VALUE]) => OBJECT</macro>
    40 
    41 Evaluates {{EXPR}} returning its value if successful (possibly after
     39<syntax>(amb-find EXPRESSION [FAILURE-VALUE]) => OBJECT</syntax>
     40
     41Evaluates {{EXPRESSION}} returning its value if successful (possibly after
    4242backtracking).
    4343
    44 If {{EXPR}} cannot be evaluated successfully and the expression tree is
     44If {{EXPRESSION}} cannot be evaluated successfully and the expression tree is
    4545exhausted, {{FAILURE-VALUE}} is evaluated and the result is returned instead.
    4646
     
    5151=== amb-collect
    5252
    53 <macro>(amb-collect EXPR) => LIST</macro>
    54 
    55 Evaluates {{EXPR}} and performs backtracking repeatedly until all possible
     53<syntax>(amb-collect EXPRESSION) => LIST</syntax>
     54
     55Evaluates {{EXPRESSION}} and performs backtracking repeatedly until all possible
    5656values for it have been accumulated in a list, which is returned.
    5757
    5858=== amb-assert
    5959
    60 <macro>(amb-assert OK?)</macro>
     60<syntax>(amb-assert OK?)</syntax>
    6161
    6262Evaluates {{OK?}} and fails if it is {{#f}}.
     
    116116procedure.
    117117
     118
    118119=== Extension ''amb-extras''
    119120
    120121=== choose
    121122
    122 <macro>(choose LIST) => TOP</macro>
     123<syntax>(choose LIST) => TOP</syntax>
    123124
    124125{{amb/random}} but with a single list argument.
     
    126127==== one-of
    127128
    128 <macro>(one-of EXPR) => OBJECT</macro>
    129 
    130 {{amb-find}}.
     129<syntax>(one-of EXPRESSION) => OBJECT</syntax>
     130
     131{{amb-find}} synonym.
    131132
    132133==== all-of
    133134
    134 <macro>(all-of EXPR) => LIST</macro>
    135 
    136 {{amb-collect}}.
     135<syntax>(all-of EXPRESSION) => LIST</syntax>
     136
     137{{amb-collect}} synonym.
    137138
    138139=== required
    139140
    140 <macro>(required EXPR)</macro>
    141 
    142 {{amb-asset}}.
     141<syntax>(required EXPRESSION)</syntax>
     142
     143{{amb-asset}} synonym.
    143144
    144145=== distinct?
    145146
    146 <procedure>(distinct? LIST) => BOOLEAN</procedure>
    147 
    148 Is {{LIST}} a list of distinct elements, as determined by {{equal?}}?
     147<procedure>(distinct? LIST [EQUIVALENCE? equal?]) => BOOLEAN</procedure>
     148
     149Is {{LIST}} a list of distinct elements, as determined by {{EQUIVALENCE?}}?
    149150
    150151
     
    203204    (required (> miller cooper))
    204205
    205     ;; Smith does not live on a floor adjacent to Fletcher's. 
     206    ;; Smith does not live on a floor adjacent to Fletcher's.
    206207    (required (not (= (abs (- smith fletcher)) 1)))
    207208
     
    220221== Requirements
    221222
     223[[check-errors|check-errors]]
     224
    222225
    223226== Bugs and Limitations
     
    231234== Version history
    232235
     236; 2.1.0 : Use of "check-errors" extension. [[/users/kon lovett|kon lovett]]
    233237; 2.0.0 : Chicken 4 release. [[/users/kon lovett|kon lovett]]
    234238
Note: See TracChangeset for help on using the changeset viewer.