Changeset 29132 in project


Ignore:
Timestamp:
06/19/13 13:34:00 (8 years ago)
Author:
juergen
Message:

method and the checkers changed in multi-methods

File:
1 edited

Legend:

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

    r29122 r29132  
    5656==== method
    5757
    58 <macro>(method [variadic?] (proc-name proc effect-checker doc . docs) (name pred . preds) ...)</macro>
     58<macro>(method [variadic?] (proc-name proc effect-checker) (name pred . preds) ...)</macro>
    5959
    6060constructor. proc ist the actual procedure to be performed,
    61 effect-checker one of no-checker query-checker or command-checker, pred and preds
     61effect-checker one of no-checker, query-checker or command-checker, pred and preds
    6262are predicates to check the procedures arguments in sequence, variadic?
    6363is a boolean which defaults to #f
     
    6565==== no-checker
    6666
    67 <macro>(no-checker doc . docs)</macro>
     67<macro>(no-checker doc0 doc1 ...)</macro>
    6868
    6969returns a procedure, which returns its only procedure argument
    70 unchecked.
     70unchecked. The docs describe the procedure's effects.
    7171
    7272==== command-checker
    7373
    74 <macro>(command-checker check0 check1 ...)</macro>
    75 
    76 returns a procedure, which checks the effects of its only argument, a
    77 command, by means of check0 check1 ..., returning its argument after
    78 having checked the effects. The checks are procedures of the same
    79 arguments as command returning three values, query, compare and doc.
     74<macro>(command-checker (check0 doc0) (check1 doc1) ...)</macro>
     75
     76returns a procedure, which checks the side-effects of its only argument, a
     77command, by means of check0 check1 ..., returning command after
     78having checked the side-effects. The checks are procedures of the same
     79arguments as command returning two values, query and compare.
    8080The first is the result of calling the query, which accompanies the
    8181command (consider the pair car and set-car! for example), the second a
    8282comparison routine which compares the result of the query-call before
    83 and after the command-call, and the third a list of documentation
    84 strings or quoted objects.
     83and after the command-call. The docs describe the procedure's effects
     84and are used for error-messages.
    8585
    8686==== query-checker
    8787
    88 <macro>(query-checker check0 check1 ...)</macro>
     88<macro>(query-checker (check0 doc0) (check1 doc1) ...)</macro>
    8989
    9090returns a procedure, which checks the return values of its only
    91 argument, a query, by means of check0 check1 ..., returning its argument
    92 after having checked the effects. The checks are procedures of the same
    93 arguments as query returning two values, a predicate, checking the
    94 result and documentation. 'The number of checks must be equal to the
    95 number of the queries return values.
     91argument, a query, by means of check0 check1 ..., returning the query
     92after having checked the return values. The checks are procedures of the
     93same arguments as query returning a predicate, checking the result. The
     94number of checks must be equal to the number of the query's return
     95values. The docs describe the procedure's effects and are used for
     96error-messages.
    9697
    9798==== method?
     
    129130<procedure>(method-effects meth)</procedure>
    130131
    131 returns the list of names of its method argument's effects.
     132returns the list of docs stored in the effect-checkers.
    132133
    133134==== effects-checked?
     
    135136<parameter>(effects-checked? [boolean])</parameter>
    136137
    137 gets or sets a parameter.
     138gets or sets a parameter. Without being set no effect checks are
     139performed.
    138140
    139141=== The module multi-methods
     
    201203== Last update
    202204
    203 June 18, 2013
     205June 19, 2013
    204206
    205207== Author
     
    240242== Version History
    241243
     244: 0.4 : method and the checkers changed
    242245: 0.3 : syntax and implementation of query-checker changed
    243 
    244246: 0.2 : no-checker added
    245247; 0.1 : initial import
Note: See TracChangeset for help on using the changeset viewer.