Changeset 33909 in project


Ignore:
Timestamp:
03/25/17 21:50:44 (4 weeks ago)
Author:
kon
Message:

rel moremacros 1.4, remote-mailbox 2.1, fix version history for srfi-27

Location:
wiki/eggref/4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/moremacros

    r25610 r33909  
    144144
    145145See [[hash-let]] for an example of use.
     146
     147==== warning-guard
     148
     149<macro>(warning-guard GETTER-NAME TYPENAME [BODY...])</macro>
     150
     151Constructs a variable or parameter guard procedure that generates a warning and
     152returns the current value when the type predicate fails, otherwise the
     153submitted value is returned.
     154
     155{{TYPENAME}} is an {{identifier}} and {{TYPENAME?}} is a {{(procedure (*)
     156boolean)}}.
     157
     158{{GETTER-NAME}} is an {{identifier}} and the name of a {{procedure _ *}}.
     159
     160{{BODY}} is zero or more expressions that are performed after a successful
     161typecheck. ''Note'' that since the guard is invoked by a {{variable}} or
     162{{parameter}} during initialization, so will be the body code.
     163
     164<enscript highlight="scheme">
     165(use variable-item)
     166
     167(warning-guard some-var integer)
     168</enscript>
     169
     170==== checked-guard
     171
     172<macro>(checked-guard GETTER-NAME TYPENAME [BODY...])</macro>
     173
     174Constructs a variable or parameter guard procedure that uses a type check
     175procedure to verify the submitted value is returned.
     176
     177{{TYPENAME}} is an {{identifier}} and {{check-TYPENAME}} is a {{(procedure ((or #f
     178symbol) * #!optional (or symbol string)) *)}}. See [[check-errors]] for a suite
     179of these procedures.
     180
     181{{GETTER-NAME}} is an {{identifier}} and the name of a {{procedure _ *}}.
     182
     183{{BODY}} is zero or more expressions that are performed after a successful
     184typecheck. ''Note'' that since the guard is invoked by a {{variable}} or
     185{{parameter}} during initialization, so will be the body code.
     186
     187<enscript highlight="scheme">
     188(use variable-item type-checks)
     189
     190(checked-guard some-var integer)
     191</enscript>
     192
     193==== define-warning-parameter
     194
     195<macro>(define-warning-parameter NAME INIT TYPENAME [BODY...])</macro>
     196
     197Wrapper around {{define-parameter}} and {{warning-guard}} that defines the
     198parameter {{NAME}} to the ''parameter''.
     199
     200{{NAME}} is an {{identifier}}.
     201
     202{{INIT}} is some Scheme {{object}}.
     203
     204{{TYPENAME}} is an {{identifier}}. The basename of a type predicate; see
     205[[#warning-guard|warning-guard]].
     206
     207{{BODY...}} as for {{warning-guard}}.
     208
     209<enscript highlight="scheme">
     210(use parameter-item)
     211
     212(define-warning-variable scale * procedure)
     213(scale 23) ;=> Warning: (foo) "bad argument type - not a procedure" 23
     214</enscript>
     215
     216==== define-checked-parameter
     217
     218<macro>(define-checked-parameter NAME INIT TYPENAME [BODY...])</macro>
     219
     220Wrapper around {{define-parameter}} and {{checked-guard}} that defines the
     221variable {{NAME}} to the ''parameter''.
     222
     223{{NAME}} is an {{identifier}}.
     224
     225{{INIT}} is some Scheme {{object}}.
     226
     227{{TYPENAME}} is an {{identifier}}. The basename of a type predicate; see
     228[[#checked-guard|checked-guard]].
     229
     230{{BODY...}} as for {{checked-guard}}.
     231
     232<enscript highlight="scheme">
     233(use parameter-item)
     234
     235(define-checked-parameter scale * procedure)
     236(scale 23) ;=> Error: (foo) "bad argument type - not a procedure" 23
     237</enscript>
    146238
    147239
     
    313405
    314406
     407== Requirements
     408
     409[[check-errors]]
     410
     411
    315412== Author
    316413
     
    320417== Version history
    321418
     419; 1.4.0 : Added {{warning-guard}}, {{checked-guard}}, {{define-warning-parameter}}, & {{define-checked-parameter}}.
    322420; 1.3.0 : Added {{make-reference-let}} and {{hash-let}}, w/ new syntax.
    323421; 1.2.2 : Added {{set#}}. Removed {{make-reference-let}} and {{hash-let}}.
     
    331429== License
    332430
    333 Copyright (C) 2010 Kon Lovett.  All rights reserved.
     431Copyright (C) 2010-2017 Kon Lovett.  All rights reserved.
    334432
    335433Permission is hereby granted, free of charge, to any person obtaining a copy of
  • wiki/eggref/4/remote-mailbox

    r24559 r33909  
    2121
    2222==== default-remote-mailbox-hostname
     23
     24<procedure>(default-remote-mailbox-hostname [HOST-NHAME])</procedure>
     25
     26The host name to establish a remote mailbox connection. Defaults to
     27{{"localhost"}}.
     28
     29==== serializer
    2330
    2431<procedure>(default-remote-mailbox-hostname [HOST-NHAME])</procedure>
     
    3643</enscript>
    3744
    38 ==== default-remote-mailbox-serializer
    39 
    40 <procedure>(default-remote-mailbox-serializer [PROCEDURE])</procedure>
    41 
    42 The optional serialize failure handler procedure. Must be {{#f}} or a
    43 procedure/1.
    44 
    4545==== default-remote-mailbox-connect
    4646
     
    9494==== remote-mailbox-send!
    9595
    96 <procedure>(remote-mailbox-send! REMOTE-MAILBOX OBJECT [SERIALIZER])</procedure>
    97 
    98 Transmit the {{OBJECT}} to the {{REMOTE-MAILBOX}}, using the
    99 {{SERIALIZER}}, which defaults to {{(default-remote-mailbox-serializer)}}.
     96<procedure>(remote-mailbox-send! REMOTE-MAILBOX OBJECT)</procedure>
     97
     98Transmit the {{OBJECT}} to the {{REMOTE-MAILBOX}}.
    10099
    101100==== drop-remote-mailbox!
     
    120119</enscript>
    121120
    122 ==== default-remote-mailbox-deserializer
    123 
    124 <procedure>(default-remote-mailbox-deserializer [PROCEDURE])</procedure>
    125 
    126 The optional deserialize failure handler procedure. Must be {{#f}} or a
    127 procedure/2.
    128 
    129121==== default-remote-mailbox-listen
    130122
     
    142134==== make-remote-mailbox-server
    143135
    144 <procedure>(make-remote-mailbox-server [#:name NAME] [#:tcp-port TCP-PORT] [#:listen LISTEN] [#:request-limit REQUEST-LIMIT] [#:deserializer DESERIALIZER] [#:auto-create? AUTO-CREATE?] [#:debug DEBUG])</procedure>
     136<procedure>(make-remote-mailbox-server [#:name NAME] [#:tcp-port TCP-PORT] [#:listen LISTEN] [#:request-limit REQUEST-LIMIT] [#:auto-create? AUTO-CREATE?] [#:debug DEBUG])</procedure>
    145137
    146138Creates and returns a {{remote-mailbox-server}}. Uses {{make-tcp-server}} to
     
    151143; {{TCP-PORT}} : Defaults to {{(default-remote-mailbox-tcp-port)}}
    152144; {{LISTEN}} : Defaults to {{(default-remote-mailbox-listen)}}
    153 ; {{DESERIALIZER}} : Defaults to {{(default-remote-mailbox-deserializer)}}
    154145; {{REQUEST-LIMIT}} : The tcp-server upper limit for currently executing requests. Defaults to {{10000}}.
    155146; {{AUTO-CREATE?}} : Automatically create local-mailbox. Defaults to {{#t}}
     
    177168
    178169<procedure>(remote-mailbox-server-auto-create? REMOTE-MAILBOX-SERVER)</procedure>
    179 
    180 ==== remote-mailbox-server-deserializer
    181 
    182 <procedure>(remote-mailbox-server-deserializer REMOTE-MAILBOX-SERVER)</procedure>
    183170
    184171==== remote-mailbox-server-listener
     
    277264
    278265The {{thread}} object for {{local-mailbox}}.
     266
     267
     268=== Adapter
     269
     270==== Usage
     271
     272<enscript language=scheme>
     273(require-extension remote-mailbox-adapter)
     274</enscript>
     275
     276==== serializer
     277
     278<procedure>(serializer [PROCEDURE])</procedure>
     279
     280Parameter for Scheme object serialization procedure. Default is {{s11n::serialize}}.
     281
     282==== deserializer
     283
     284<procedure>(deserializer [PROCEDURE])</procedure>
     285
     286Parameter for Scheme object deserialization procedure. Default is {{s11n::deserialize}}.
     287
     288==== deserializer-input
     289
     290<procedure>(deserializer-input [INPUT-PORT])</procedure>
     291
     292Parameter for deserialization procedure input. Default is {{(current-input-port)}}.
     293
     294==== serializer-output
     295
     296<procedure>(serializer-output [OUTPUT-PORT])</procedure>
     297
     298Parameter for serialization procedure output. Default is {{(current-output-port)}}.
     299
     300==== serialize
     301
     302<procedure>(serialize OBJECT [OUTPUT-PORT (serializer-output)])</procedure>
     303
     304Serialize the {{OBJECT}} to the {{OUTPUT-PORT}}.
     305
     306==== deserialize
     307
     308<procedure>(deserialize [INPUT-PORT (deserializer-input)]) => OBJECT</procedure>
     309
     310Deserialize the {{OBJECT}} from the {{INPUT-PORT}}.
    279311
    280312
     
    308340== Version history
    309341
     342; 2.1.0 : remove {{default-remote-mailbox-serializer}}, {{default-remote-mailbox-deserializer}}, & associated parameters. Add {{remote-mailbox-adapter}}.
    310343; 2.0.1 : Explicit requirements.
    311344; 2.0.0 : Initial Chicken 4 release.
     
    314347== License
    315348
    316 Copyright (C) 2009 Kon Lovett.  All rights reserved.
     349Copyright (C) 2009-2017 Kon Lovett.  All rights reserved.
    317350
    318351Permission is hereby granted, free of charge, to any person obtaining a
  • wiki/eggref/4/srfi-27

    r33881 r33909  
    647647
    648648<enscript language=scheme>
    649 (use srfi-27 mwc srfi-27-uniform-random srfi-27-vector entropy-unix entropy-port)
     649(use srfi-27 srfi-27-uniform-random srfi-27-vector mwc entropy-unix entropy-port)
    650650
    651651(define (make-random-k-vector #!optional (k 1024))
     
    794794; 3.1.2 : Fix for "entropy-windows" {{make-entropy-source-crypt}}.
    795795; 3.1.1 : Moved thread stuff to own extensions.
    796 ; 3.1.0 : Changed all {{random-source-name}} to lowercase symbols. Changed {{random-state}} tags to same as {{random-source-name}}. Added {{new-(random|entroppy)-source}}, {{@(random|entroppy)-source-constructor}} & {{(random|entroppy)-source-name}}. Exported {{registered-(random|entroppy)-sources}} & {{registered-(random|entroppy)-source}}.
     796; 3.1.0 : Changed all {{random-source-name}} to lowercase symbols. Changed {{random-state}} tags to same as {{random-source-name}}. Added {{new-(random|entropy)-source}}, {{@(random|entropy)-source-constructor}} & {{(random|entropy)-source-name}}. Exported {{registered-(random|entropy)-sources}} & {{registered-(random|entropy)-source}}.
    797797; 3.0.1 : Bug fix for bad external state symbol. Use of 64-bit arithmetic instead of double in C code.
    798798; 3.0.0 : Initial release for Chicken 4
Note: See TracChangeset for help on using the changeset viewer.