Changeset 15376 in project


Ignore:
Timestamp:
08/09/09 17:09:36 (10 years ago)
Author:
certainty
Message:

Changes applied for certainty (82.82.131.238) through svnwiki:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/uri-dispatch

    r15343 r15376  
    1111=== Requirements
    1212
    13 Requires the [[uri-common]] and [[environments]]extensions.
     13Requires the [[uri-common]] and [[environments]] extensions.
    1414
    1515=== Documentation
    1616
    17 Will come soon
     17<procedure>(dispatch-uri URI)</procedure>
     18
     19The main interface to dispatch-uri. This procedure invokes the dispatch-mechanism with the supplied uri.
     20The dispatch-algorithm is implemented as follows:
     21
     22*  The path is empty. It checks if '''default-dispatch-target''' is non-false.
     23   If it is, then it is invoked. If it is not '''dispatch-error''' is invoked.
     24
     25* The path has exactly one element. It assumes that this is this element is the name
     26   of a thunk that was defined outside a module. If the such a thunk exists it is invoked.
     27   If no such a thunk exists it invokes '''dispatch-error'''.
     28
     29* The path contains at least two elements.
     30** It checks if the second element is a procedure defined
     31  in a module named by the first element. So if it sees (foo bar) it tries to find the procedure foo
     32  inside the module bar. If the procedure exists it is invoked with the rest of the elements as arguments.
     33**  If it does not exist, it interpretes the first element as the name of a procedure that was defined
     34  outside any module. If such a procedure exists, it is invoked passing the rest of the elements as arguments.
     35  If no such procedure exists '''dispatch-error''' is invoked with the full path as argument.
     36
    1837
    1938=== Examples
Note: See TracChangeset for help on using the changeset viewer.