Changeset 37429 in project for wiki/eggref/5/procedural-macros


Ignore:
Timestamp:
03/20/19 15:50:10 (21 months ago)
Author:
juergen
Message:

procedural-macros docu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/procedural-macros

    r37423 r37429  
    2525scene as well?
    2626
    27 This library provides the means for this to happen.
    28 
    29 === Module macro-helpers
    30 
    31 Some of the following procedures are used in the macros of the
    32 basic-macros module. Others are here for completeness, for example the
    33 pseudo-list package.
    34 
    35 ==== macro-helpers
    36 
    37 <procedure>(macro-helpers sym ..)</procedure>
    38 
    39 documentation procedure
    40 
    41 ==== pseudo-list
    42 
    43 <procedure>(pseudo-list sentinel . args)</procedure>
    44 
    45 constructs a new pseudo-list.
    46 
    47 ==== pseudo-list?
    48 
    49 <procedure>(pseudo-list? xpr)</procedure>
    50 
    51 predicate. Note, that except lists everything is a pseudo-list.
    52 
    53 ==== pseudo-list-of
    54 
    55 <procedure>(pseudo-list-of . preds)</procedure>
    56 
    57 returns a unary predicate, which tests, if its argument is
    58 passed by each predicate in preds.
    59 
    60 ==== pseudo-null?
    61 
    62 <procedure>(pseudo-null? xpr)</procedure>
    63 
    64 not a pair.
    65 
    66 ==== pseudo-length
    67 
    68 <procedure>(pseudo-length pl)</procedure>
    69 
    70 length of a pseudo-list. The sentinel is not counted.
    71 
    72 ==== pseudo-ref
    73 
    74 <procedure>(pseudo-ref pl k)</procedure>
    75 
    76 returns the kth item of a pseudo-list. k must be less then pl's
    77 pseudo-length.
    78 
    79 ==== pseudo-tail
    80 
    81 <procedure>(pseudo-tail pl k)</procedure>
    82 <procedure>(pseudo-tail pl)</procedure>
    83 
    84 returns the kth tail of a pseudo-list. k must be less then or equal to pl's
    85 pseudo-length. In the latter case, or when no k is provided,
    86 the sentinel is returned.
    87 
    88 ==== pseudo-head
    89 
    90 <procedure>(pseudo-head pl k)</procedure>
    91 <procedure>(pseudo-head pl)</procedure>
    92 
    93 returns the kth tail of a pseudo-list. k must be less then or equal to pl's
    94 pseudo-length. In the latter case, or when no k is provided,
    95 a list with the sentinel stripped is returned.
    96 
    97 ==== pseudo-sentinel
    98 
    99 <procedure>(pseudo-sentinel pl)</procedure>
    100 
    101 returns the sentinel of a pseudo-list. If pl is not a pair, pl itself is
    102 returned.
    103 
    104 ==== pseudo-flatten
    105 
    106 <procedure>(pseudo-flatte tree)</procedure>
    107 
    108 transforms a nested pseudo-list to a flat list.
    109 
    110 ==== adjoin
    111 
    112 <procedure>(adjoin obj lst)</procedure>
    113 
    114 adds obj to lst, provided obj is not an item of lst.
    115 
    116 ==== remove-duplicates
    117 
    118 <procedure>(remove-duplicates lst)</procedure>
    119 
    120 removes all duplicates of lst.
    121 
    122 ==== filter
    123 
    124 <procedure>(filter ok? lst)</procedure>
    125 
    126 returns the sublist of lst consisting of all items passing the ok?
    127 predicate.
    128 
    129 ==== sym-prepends?
    130 
    131 <procedure>(sym-prepends? pre sym)</procedure>
    132 
    133 does the symbol sym start with the symbol pre?
    134 
    135 ==== sym-tail
    136 
    137 <procedure>(sym-tail pre sym)</procedure>
    138 
    139 returns the subsymbol of sym by stripping the prefix pre.
     27This library provides the means for this to happen in the form of two
     28modules, basic-macros and procedural-macros. The latter exports the
     29symbols of the former as well, so that in general only the latter is
     30needed.
    14031
    14132=== Module basic-macros
     
    268159dots, zero or one time, 4 dots one ore several times.
    269160
    270 
    271161This form can be used instead of syntax-rules in define-syntax,
    272162let-sytax and letrec-syntax, provided, you use it for-syntax.
     
    397287(import procedural-macros)
    398288
    399 (use-for-syntax
     289(import-for-syntax
    400290 (only procedural-macros macro-rules once-only
    401291                         with-mapped-symbols with-gensyms)
     
    594484== Last update
    595485
    596 Mar 19, 2019
     486Mar 20, 2019
    597487
    598488== Author
Note: See TracChangeset for help on using the changeset viewer.