Changeset 29242 in project


Ignore:
Timestamp:
06/26/13 12:35:44 (8 years ago)
Author:
juergen
Message:

multi-methods version 0.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/multi-methods

    r29161 r29242  
    4343==== methods
    4444
    45 <procedure>(methods [sym])</procedure>
    46 
    47 documentation procedure. If called without arguments prints the list of
    48 exported symbols, otherwise the documentation of the exported symbol
    49 sym.
     45<procedure>(methods)</procedure>
     46
     47documentation procedure. Shows list of exported symbols.
     48Pre- and post-conditions of a  method can be ispected with
     49method-assumptions and method-effects.
    5050
    5151==== method
    5252
    53 <macro>(method [variadic?] (proc-name proc effect-checker) (name pred . preds) ...)</macro>
     53<macro>(method [variadic?] (proc-name proc effect-checker) (arg-name pred . preds) ...)</macro>
    5454
    5555constructor. proc ist the actual procedure to be performed,
    5656effect-checker one of no-checker, query-checker or command-checker, pred and preds
    57 are predicates to check the procedures arguments in sequence, variadic?
     57are predicates to check the procedure's arguments in sequence, variadic?
    5858is a boolean which defaults to #f
    5959
     60==== method?
     61
     62<procedure>(method? xpr)</procedure>
     63
     64type predicate
     65
     66==== method-variadic?
     67
     68<procedure>(method-variadic? meth)</procedure>
     69
     70is the method variadic?
     71
     72==== method-arity
     73
     74<procedure>(method-arity meth)</procedure>
     75
     76returns the arity of its method argument.
     77
     78==== method-name
     79
     80<procedure>(method-name meth)</procedure>
     81
     82returns the name of its method argument.
     83
     84==== method-assumptions
     85
     86<procedure>(method-assumptions meth)</procedure>
     87
     88returns the list of names of its method argument's predicates.
     89
     90==== method-effects
     91
     92<procedure>(method-effects meth)</procedure>
     93
     94returns the list of docs stored in the effect-checkers.
     95
    6096==== no-checker
    6197
    62 <macro>(no-checker doc0 doc1 ...)</macro>
     98<procedure>(no-checker doc . docs)</procedure>
    6399
    64100returns a procedure, which returns its only procedure argument
     
    67103==== command-checker
    68104
    69 <macro>(command-checker (check0 doc0) (check1 doc1) ...)</macro>
    70 
    71 returns a procedure, which checks the side-effects of its only argument, a
    72 command, by means of check0 check1 ..., returning command after
    73 having checked the side-effects. The checks are procedures of the same
    74 arguments as command returning two values, query and compare.
    75 The first is the result of calling the query, which accompanies the
    76 command (consider the pair car and set-car! for example), the second a
     105<procedure>(command-checker check doc . docs)</procedure>
     106
     107returns a procedure, which checks the side-effects of its only argument,
     108a command, by means of check, returning command after having checked the
     109side-effects. check is a procedures of the same arguments as command
     110returning an even number of values, of type query and compare.  The
     111first is the result of calling the query, which accompanies the command
     112(consider the pair car and set-car! for example), the second a
    77113comparison routine which compares the result of the query-call before
    78114and after the command-call. The docs describe the procedure's effects
     
    81117==== query-checker
    82118
    83 <macro>(query-checker check doc . docs)</macro>
     119<procedure>(query-checker check doc . docs)</procedure>
    84120
    85121returns a procedure, which checks the returned values of its only
     
    89125for error-messages.
    90126
    91 ==== method?
    92 
    93 <procedure>(method? xpr)</procedure>
    94 
    95 type predicate
    96 
    97 ==== method-variadic?
    98 
    99 <procedure>(method-variadic? meth)</procedure>
    100 
    101 is the method variadic?
    102 
    103 ==== method-arity
    104 
    105 <procedure>(method-arity meth)</procedure>
    106 
    107 returns the arity of its method argument.
    108 
    109 ==== method-name
    110 
    111 <procedure>(method-name meth)</procedure>
    112 
    113 returns the name of its method argument.
    114 
    115 ==== method-assumptions
    116 
    117 <procedure>(method-assumptions meth)</procedure>
    118 
    119 returns the list of names of its method argument's predicates.
    120 
    121 ==== method-effects
    122 
    123 <procedure>(method-effects meth)</procedure>
    124 
    125 returns the list of docs stored in the effect-checkers.
    126 
    127127==== effects-checked?
    128128
     
    136136==== multi-methods
    137137
    138 <procedure>(multi-methods [sym])</procedure>
    139 
    140 documentation procedure. If called without arguments prints the list of
    141 exported symbols, otherwise the documentation of the exported symbol
    142 sym.
     138<procedure>(multi-methods)</procedure>
     139
     140documentation procedure. Prints the sorted list of exported symbols.
    143141
    144142==== multi-method
     
    196194== Last update
    197195
    198 June 23, 2013
     196June 26, 2013
    199197
    200198== Author
     
    235233== Version History
    236234
     235: 0.6 : checkers now procedures, command-checker changed, docu-procedures only export symbols
    237236: 0.5 : query-checker simplyfied
    238237; 0.4 : method and the checkers changed
Note: See TracChangeset for help on using the changeset viewer.