Changeset 30186 in project


Ignore:
Timestamp:
12/12/13 11:15:17 (6 years ago)
Author:
juergen
Message:

documentation procedure of bindings and anaphora beautified

Location:
wiki/eggref/4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/anaphora

    r30183 r30186  
    2121=== Programming interface
    2222
     23This documentation uses special ellipses, .. and ...., to repeat the
     24pattern(s) to the left zero or one and one or many times respectively.
     25
    2326==== anaphora
    2427
    25 <macro>(anaphora sym)</macro>
    26 
    27 where sym is optional. Called without argument it returns the list of
    28 exported symbols, with one of those symbols as argument it returns its
    29 call-structure.
     28<procedure>(anaphora sym ..)</procedure>
     29
     30Documentation procedure.
     31Called without argument it returns the list of exported symbols, with
     32one of those symbols as argument it returns its documentation.
    3033
    3134==== aif
    3235
    33 <macro>(aif test consequent [alternative])</macro>
     36<macro>(aif test consequent alternative ..)</macro>
    3437
    3538Anaphoric version of if.
     
    4447==== nif
    4548
    46 <macro>(nif name test consequent [alternative])</macro>
     49<macro>(nif name test consequent alternative ..)</macro>
    4750
    4851Named version of if.
     
    8689==== acond
    8790
    88 <macro>(acond ((test xpr ...) ... [(else xpr1 ...)]))</macro>
     91<macro>(acond ((test xpr ...) ... (else ypr ...) ..))</macro>
    8992
    9093Anaphoric version of cond.
     
    105108==== ncond
    106109
    107 <macro>(ncond name ((test xpr ...) ... [(else xpr1 ...)]))</macro>
     110<macro>(ncond name ((test xpr ...) ... (else ypr ...) ..))</macro>
    108111
    109112Named version of cond.
     
    320323== Last update
    321324
    322 Dec 11, 2013
     325Dec 12, 2013
    323326
    324327== Author
     
    359362== Version History
    360363
     364; 0.5.1 : documentation procedure beautified
    361365; 0.5 : added additional hygienic named macros
    362366; 0.4 : added define-anaphor, define-properties, tree-recurser, atree-recurser, list-recurser and alist-recurser
  • wiki/eggref/4/bindings

    r30178 r30186  
    1616==== bindings
    1717
    18 Like modules written in the Design by Contract style, this module
    19 contains its documentation builtin in the form of a dispatcher routine
    20 with the modules name, bindings, which when called with no argument
    21 
    22 <enscript highlight=scheme>(bindings)</enscript>
    23 
    24 returns the list of exported symbols, namely
    25 
    26 <enscript highlight=scheme>
    27 (bindings bind bind-case bind-case-lambda bind-case-lambda* bind-define
    28  bind-lambda bind-lambda* bind-let bind-let* bind-letrec bind*
    29  bindable? bind-set! bindrec generic-null-car-cdr!)
    30 </enscript>
    31 
    32 which are all macros, except the generic-null-car-cdr! function, which is used to update the table of admissible sequence types.
    33 
    34 When calling bindings with one of this symbols, e.g.
    35 
    36 <enscript highlight=scheme>(bindings 'bind)</enscript>
    37 
    38 the documentation of this symbol in all it's glory is shown, i.e. together
    39 with admissible forms and a documentation string
    40 
    41 <enscript highlight=scheme>
    42 (bind pat seq (where . fenders) .. xpr . xprs)
    43 binds pattern variables of pat to subexpressions of seq
    44 and executes xpr . xprs in this context. Fenders can be used to reject
    45 an otherwise matching pattern.
    46 </enscript>
    47 
     18<procedure>(bindings sym ..)</procedure>
     19
     20Documentation procedure.
     21Called without argument it returns the list of exported symbols, with
     22one of those symbols as argument it returns its documentation.
    4823
    4924====  bind
    5025
    51 <syntax>(bind pat seq xpr . xprs)</syntax>
    52 <syntax>(bind pat seq (where . fenders) xpr . xprs)</syntax>
     26<macro>(bind pat seq (where . fenders) .. xpr . xprs)</macro>
    5327
    5428binds pattern variables of pat to subexpressions of seq and executes xpr . xprs in this context, provided all fenders return #t, if supplied.
     
    5630==== bindable?
    5731
    58 <syntax>(bindable? pat . fenders)</syntax>
     32<macro>(bindable? pat . fenders)</macro>
    5933
    6034returns a unary predicate which checks, if its sequence argument matches
     
    6337====  bind-case
    6438
    65 <syntax>(bind-case seq clause ....)</syntax>
    66 
    67 where seq is a sequence expression and each clause is of one of two forms
    68 
    69 <enscript highlight=scheme>
    70 (pat (where . fenders) xpr . xprs)
    71 (pat xpr . xprs)
    72 </enscript>
     39<macro>(bind-case seq (pat (where . fenders) .. xpr . xprs) ....)</macro>
    7340
    7441Matches seq against a series of patterns and executes the body of the
     
    7744==== bind-case-lambda
    7845
    79 <syntax>(bind-case-lambda clause ....)</syntax>
    80 
    81 where each clause is of one of two forms
    82 
    83 <enscript highlight=scheme>
    84 (pat (where . fenders) xpr . xprs)
    85 (pat xpr . xprs)
    86 </enscript>
     46<macro>(bind-case-lambda (pat (where . fenders) .. xpr . xprs) ....)</macro>
    8747
    8848Combination of bind-case and lambda with one pattern argument
     
    9050==== bind-case-lambda*
    9151
    92 <syntax>(bind-case-lambda* clause ....)</syntax>
    93 
    94 where each clause is of one of two forms
    95 
    96 <enscript highlight=scheme>
    97 (pat (where . fenders) xpr . xprs)
    98 (pat xpr . xprs)
    99 </enscript>
     52<macro>(bind-case-lambda* (pat (where . fenders) .. xpr . xprs) ....)</macro>
    10053
    10154Combination of bind-case and lambda with multiple pattern arguments
     
    10356==== bind-lambda
    10457
    105 <syntax>(bind-lambda pat (where . fenders) xpr . xprs)</syntax>
    106 <syntax>(bind-lambda pat xpr . xprs)</syntax>
     58<macro>(bind-lambda pat (where . fenders) .. xpr . xprs)</macro>
    10759
    10860combination of lambda and bind, one pattern argument
     
    11062====  bind-lambda*
    11163
    112 <syntax>(bind-lambda* pat (where . fenders) xpr . xprs)</syntax>
    113 <syntax>(bind-lambda* pat xpr . xprs)</syntax>
     64<macro>(bind-lambda* pat (where . fenders) .. xpr . xprs)</macro>
    11465
    11566combination of lambda and bind, multiple pattern arguments
     
    11768====  bind-let
    11869
    119 <syntax>(bind-let loop ((pat seq) ...) xpr . xprs)</syntax>
    120 <syntax>(bind-let ((pat seq) ...) xpr . xprs)</syntax>
     70<macro>(bind-let loop .. ((pat seq) ...) xpr . xprs)</macro>
    12171
    12272like let, named and unnamed, but binds patterns to sequence templates.  In the named case loop is bound to a one-parameter-procedure accessible in the body xpr . xprs
     
    12474==== bind-let*
    12575
    126 <syntax>(bind-let* ((pat seq) ...) xpr . xprs)</syntax>
     76<macro>(bind-let* ((pat seq) ...) xpr . xprs)</macro>
    12777
    12878like let*, but binds patterns to sequence templates
     
    13080==== bind-letrec
    13181
    132 <syntax>(bind-letrec ((pat seq) ...) xpr . xprs)</syntax>
     82<macro>(bind-letrec ((pat seq) ...) xpr . xprs)</macro>
    13383
    13484like letrec, but binds patterns to sequence templates
     
    13686==== bind*
    13787
    138 <syntax>(bind* loop pat seq xpr . xprs)</syntax>
    139 
    140 bind* is for bind what named let is for let. proc is bound to a one-parameter procedure, which can be used in the body xpr . xprs
     88<macro>(bind* loop pat seq xpr . xprs)</macro>
     89
     90named version of bind.
     91loop is bound to a one-parameter procedure, which can be used in the body xpr . xprs
    14192
    14293==== bindrec
    14394
    144 <syntax>(bindrec pat seq xpr . xprs)</syntax>
     95<macro>(bindrec pat seq xpr . xprs)</macro>
    14596
    14697bind pattern variables of pat to subsequences of seq recursively
     
    14899==== bind-define
    149100
    150 <syntax>(bind-define pat seq)</syntax>
     101<macro>(bind-define pat seq)</macro>
    151102
    152103defines pattern variables of pat with values matching subexpressions of seq in one go
     
    154105==== bind-set!
    155106
    156 <syntax>(bind-set! pat seq)</syntax>
     107<macro>(bind-set! pat seq)</macro>
    157108
    158109sets symbols of pat to corresponding subexpressions of seq
     
    160111==== generic-null-car-cdr!
    161112
    162 <procedure>(generic-null-car-cdr! type-pred null-proc car-proc cdr-proc)</procedure>
    163 
    164 updates the table of generic functions.
     113<procedure>(generic-null-car-cdr! type? gnull? gcar gcdr)</procedure>
     114
     115updates the tables of three generic functions.
    165116
    166117As implemented, the binding macros can handle arbitrary nested combinations of (pseudo-)lists, vectors and strings. But updating the table additional sequence types can be handled without touching the macros' code.
     
    365316== Last update
    366317
    367 Dec 10, 2013
     318Dec 12, 2013
    368319
    369320== Author
     
    404355== Version History
    405356
     357; 2.4.1 : documentation procedure beautified
    406358; 2.4 : generic functions rewritten, records removed from tests
    407359; 2.3.4 : internal generic-pair? added again bugfixed
Note: See TracChangeset for help on using the changeset viewer.