Changeset 21067 in project


Ignore:
Timestamp:
10/26/10 04:03:40 (8 years ago)
Author:
kon
Message:

Updated for new release.

Location:
wiki/eggref/4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/message-digest

    r19761 r21067  
    122122
    123123<procedure>(message-digest-chunk-read-maker) => (procedure (input-port) (procedure () <byte-source>))</procedure>
    124 <procedure>(message-digest-chunk-read-maker [CONSTRUCTOR])</procedure>
     124<procedure>(message-digest-chunk-read-maker CONSTRUCTOR)</procedure>
    125125
    126126Supplies the procedure used to create an input procedure.
    127127
    128 {{CONSTRUCTOR}} is a {{(procedure (input-port) (procedure () <byte-source>))}}.
     128{{CONSTRUCTOR}} is a {{(procedure (input-port #!optional positive-integer)
     129(procedure () <byte-source>))}}. The first argument is the chunk source port
     130and the second argument is the size of chunks.
    129131
    130132The default {{CONSTRUCTOR}} will return a procedure that reads from
     
    415417
    416418=== Utility Procedures
    417 
    418 ==== byte-string->hexadecimal
    419 ==== string->hex
    420 
    421 <procedure>(byte-string->hexadecimal STRING [START [END]]) => string</procedure>
    422 <procedure>(string->hex STRING [START [END]]) => string</procedure>
    423 
    424 Returns a hex-encoded representation of {{STRING}}, on the interval [{{START}}
    425 {{END}}). Defaults are [{{0}} {{string-length}}).
    426 
    427 ('''Note''' that lowercase hex digits are used, as with {{number->string}}.)
    428419
    429420==== Byte Packing
     
    688679== Version history
    689680
     681; 2.3.2 : Deprecated {{byte-string->hexadecimal}}. Deprecated {{string->hex}}, use [[string-utils]] {{string-hexadecimal#string->hex}}. Fix for the default {{message-digest-chunk-read-maker}}, blob was always chunk-size.
     682; 2.3.1 :
    690683; 2.3.0 : Added {{message-digest-update-char-u8}}, {{message-digest-update-char-be}}, and {{message-digest-update-char-le}}. {{message-digest-update-char}} now treats the actual bit-width of char correctly.
    691684; 2.2.0 : Added [[Byte Packing]] API. Downgraded {{message-digest-chunk-read-maker}}, {{message-digest-chunk-size}} & {{message-digest-chunk-converter}} from {{parameter}}.
  • wiki/eggref/4/moremacros

    r19761 r21067  
    145145==== make-variable
    146146
    147 <procedure>(make-variable INIT [GUARD [TYPE-NAME]]) => (procedure * *)</procedure>
    148 
    149 Returns a {{procedure}} whose behavior is that of {{make-parameter}}, except
    150 for the fact that it is '''not''' a {{parameter}}.
    151 
    152 {{GUARD}} is a {{(procedure (*) boolean)}} testing the acceptability of the
    153 variable value. Default is no checking.
    154 
    155 {{TYPE-NAME}} is a {{symbol}} or {{string}} describing the type tested by
    156 {{GUARD}}. Default is generic.
    157 
    158 When the {{GUARD}} fails a {{warning}} is produced.
     147<procedure>(make-variable INIT [GUARD]) => (procedure _ *)</procedure>
     148
     149Returns a {{procedure}} whose behavior is that of a {{parameter}}, except for
     150the fact that it is '''not''' a {{parameter}}. The closed-over value is not
     151thread-local.
     152
     153{{INIT}} is some Scheme {{object}} that meets the constraint enforced by the
     154{{GUARD}}.
     155
     156{{GUARD}} is a {{(procedure (*) *)}} returning an acceptable value for the
     157variable. Default is {{identity}}.
     158
     159Supports SRFI 17.
     160
     161==== warning-quard
     162
     163<macro>(warning-quard GETTER-NAME TYPENAME)</macro>
     164
     165Constructs a variable or parameter guard procedure that generates a warning and
     166returns the current value when the type predicate fails, otherwise the
     167submitted value is returned.
     168
     169{{TYPENAME}} is an {{identifier}} and {{TYPENAME?}} is a {{(procedure (*)
     170boolean)}}.
     171
     172{{GETTER-NAME}} is an {{identifier}} and the name of a {{procedure _ *}}.
     173
     174<enscript highlight="scheme">
     175(use variable-item)
     176
     177(warning-quard some-var integer)
     178</enscript>
     179
     180==== checked-quard
     181
     182<macro>(checked-quard GETTER-NAME TYPENAME)</macro>
     183
     184Constructs a variable or parameter guard procedure that uses a type check
     185procedure to verify the submitted value is returned.
     186
     187{{TYPENAME}} is an {{identifier}} and {{check-TYPENAME}} is a {{(procedure ((or #f
     188symbol) * #!optional (or symbol string)) *)}}. See [[check-errors]] for a suite
     189of these procedures.
     190
     191{{GETTER-NAME}} is an {{identifier}} and the name of a {{procedure _ *}}.
     192
     193<enscript highlight="scheme">
     194(use variable-item type-checks)
     195
     196(checked-quard some-var integer)
     197</enscript>
    159198
    160199==== define-variable
    161200
    162 <macro>(define-variable NAME INIT [GUARD [TYPE-NAME]])</macro>
    163 
    164 Assigns a {{make-variable}} to the variable {{NAME}}.
    165 
    166 {{NAME}} is a {{symbol}}.
    167 
    168 {{GUARD}} and {{TYPE-NAME}} are as for {{make-variable}}
    169 
    170 <enscript highlight="scheme">
    171 (use moremacros)
    172 
    173 (define-variable scale * procedure? 'procedure)
    174 (scale)
    175 ; => #<procedure ...>
    176 
    177 (scale 23)
    178  ;=> ;; Warning: "bad argument type - not a procedure" : 23
    179 
     201<macro>(define-variable NAME INIT [GUARD])</macro>
     202
     203Wrapper around {{make-variable}} that defines the variable {{NAME}} to the ''variable''.
     204
     205{{NAME}} is an {{identifier}}.
     206
     207{{INIT}} and {{GUARD}} as for {{make-variable}}.
     208
     209<enscript highlight="scheme">
     210(use variable-item)
     211
     212(define-variable scale * (warning-guard scale procedure))
     213(scale) ;=> #<procedure ...>
    180214(scale /)
    181 
    182 (scale)
    183 ; => #<procedure ...>
     215</enscript>
     216
     217==== define-warning-variable
     218
     219<macro>(define-warning-variable NAME INIT TYPENAME)</macro>
     220
     221Wrapper around {{make-variable}} and {{warning-guard}} that defines the
     222variable {{NAME}} to the ''variable''.
     223
     224{{NAME}} is an {{identifier}}.
     225
     226{{INIT}} is some Scheme {{object}}.
     227
     228{{TYPENAME}} is an {{identifier}}. The basename of a type predicate; see
     229[[#warning-quard|warning-quard]].
     230
     231<enscript highlight="scheme">
     232(use variable-item)
     233
     234(define-warning-variable scale * procedure)
     235(scale 23) ;=> Warning: (foo) "bad argument type - not a procedure" 23
     236</enscript>
     237
     238==== define-checked-variable
     239
     240<macro>(define-checked-variable NAME INIT TYPENAME)</macro>
     241
     242Wrapper around {{make-variable}} and {{checked-guard}} that defines the
     243variable {{NAME}} to the ''variable''.
     244
     245{{NAME}} is an {{identifier}}.
     246
     247{{INIT}} is some Scheme {{object}}.
     248
     249{{TYPENAME}} is an {{identifier}}. The basename of a type predicate; see
     250[[#checked-quard|checked-quard]].
     251
     252<enscript highlight="scheme">
     253(use variable-item)
     254
     255(define-checked-variable scale * procedure)
     256(scale 23) ;=> Error: (foo) "bad argument type - not a procedure" 23
    184257</enscript>
    185258
     
    359432== Version history
    360433
     434; 1.2.0 : Aligned {{make-variable}} better with {{make-parameter}}.
     435; 1.1.1 :
    361436; 1.1.0 : Added {{make-reference-let}}. Split {{make-variable}} & {{define-variable}} into own module {{variable-item}}.
    362437; 1.0.0 : Hello
Note: See TracChangeset for help on using the changeset viewer.