Changeset 33549 in project


Ignore:
Timestamp:
07/31/16 01:01:50 (4 years ago)
Author:
Jeremy Steward
Message:

Fixes dumb qwiki syntax mistakes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/srfi-128

    r33545 r33549  
    6060standard Scheme types:
    6161
    62 <emscript highlight="scheme">
     62<enscript highlight="scheme">
    6363(make-comparator boolean? boolean=? (lambda (x y) (and (not x) y)) boolean-hash)
    64 </emscript>
     64</enscript>
    6565
    6666will return a comparator for booleans, expressing the ordering {{#f}} < {{#t}} and the
    6767standard hash function for booleans.
    6868
    69 <emscript highlight="scheme">
     69<enscript highlight="scheme">
    7070(make-comparator real? = < (lambda (x) (exact (abs x))))
    71 </emscript>
     71</enscript>
    7272
    7373will return a comparator expressing the natural ordering of real numbers and a
    7474plausible (but not optimal) hash function.
    7575
    76 <emscript highlight="scheme">
     76<enscript highlight="scheme">
    7777(make-comparator string? string=? string<? string-hash)
    78 </emscript>
     78</enscript>
    7979
    8080will return a comparator expressing the implementation's ordering of strings
    8181and the standard hash function.
    8282
    83 <emscript highlight="scheme">
     83<enscript highlight="scheme">
    8484(make-comparator string? string-ci=? string-ci<? string-ci-hash)
    85 </emscript>
     85</enscript>
    8686
    8787will return a comparator expressing the implementation's case-insensitive
     
    103103* The type test returns {{#t}} if its argument satisfies {{type-test}} and the elements satisfy the type test predicate of element-comparator.
    104104* The total order defined by the equality and ordering functions is as follows (known as lexicographic order):
    105   * The empty sequence, as determined by calling {{empty?}}, compares equal to itself.
    106   * The empty sequence compares less than any non-empty sequence.
    107   * Two non-empty sequences are compared by calling the {{head}} procedure on each. If the heads are not equal when compared using {{element-comparator}}, the result is the result of that comparison. Otherwise, the results of calling the {{tail}} procedure are compared recursively.
     105** The empty sequence, as determined by calling {{empty?}}, compares equal to itself.
     106** The empty sequence compares less than any non-empty sequence.
     107** Two non-empty sequences are compared by calling the {{head}} procedure on each. If the heads are not equal when compared using {{element-comparator}}, the result is the result of that comparison. Otherwise, the results of calling the {{tail}} procedure are compared recursively.
    108108* The {{hash}} function computes the hash values of the elements using the hash function of {{element-comparator}} and then hashes them together in an implementation-defined way.
    109109
     
    119119Here is an example, which returns a comparator for byte vectors:
    120120
    121 <emscript highlight="scheme">
     121<enscript highlight="scheme">
    122122(make-vector-comparator
    123123  (make-comparator exact-integer? = < number-hash)
     
    125125  bytevector-length
    126126  bytevector-u8-ref)
    127 </emscript>
     127</enscript>
    128128
    129129<procedure>(make-eq-comparator)</procedure>
     
    207207
    208208* Given disjoint types {{a}} and {{b}}, one of three conditions must hold:
    209   * All objects of type {{a}} compare less than all objects of type {{b}}.
    210   * All objects of type {{a}} compare greater than all objects of type {{b}}.
    211   * All objects of both type {{a}} and type {{b}} compare equal to each other. This is not permitted for any of the Scheme types mentioned below.
     209** All objects of type {{a}} compare less than all objects of type {{b}}.
     210** All objects of type {{a}} compare greater than all objects of type {{b}}.
     211** All objects of both type {{a}} and type {{b}} compare equal to each other. This is not permitted for any of the Scheme types mentioned below.
    212212* The empty list must be ordered before all pairs.
    213213* When comparing booleans, it must use the total order {{#f}} < {{#t}}.
Note: See TracChangeset for help on using the changeset viewer.