source: project/misc-extn/trunk/misc-extn-eggdoc.scm @ 5537

Last change on this file since 5537 was 5537, checked in by Kon Lovett, 14 years ago

Bugfix for unbound stuff.

File size: 27.2 KB
Line 
1;;;; misc-extn-eggdoc.scm
2
3(use eggdoc)
4
5(define license #<<EOF
6"Copyright (c) 2006-2007, Kon Lovett.  All rights reserved.
7
8Permission is hereby granted, free of charge, to any person obtaining a
9copy of this software and associated documentation files (the Software),
10to deal in the Software without restriction, including without limitation
11the rights to use, copy, modify, merge, publish, distribute, sublicense,
12and/or sell copies of the Software, and to permit persons to whom the
13Software is furnished to do so, subject to the following conditions:
14
15The above copyright notice and this permission notice shall be included
16in all copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24OTHER DEALINGS IN THE SOFTWARE.
25EOF
26)
27
28(define examples '((pre #<<EOF
29(use misc-extn-control)
30
31(hash-let ([name (foo "wow")] some-hashtable)
32  (print name " " foo #\newline))
33
34(stiff-set! x 1 y 2)  ; x = 1 y = 2
35(fluid-set! x y y x)  ; x = 2 y = 1
36(swap-set! x y)       ; x = 1 y = 2
37
38; Silly example
39(typecase* (foo bar)
40  [(procedure macro) #f]
41  [symbol #t]
42  [(vector list) #f]
43  [else
44    (error "not what I want" it)])
45EOF
46)))
47
48(define doc `(
49  (eggdoc:begin
50    (name "misc-extn")
51    (description (p "Provides miscellaneous useful stuff."))
52    (author (url "mailto:klovett@pacbell.net" "Kon Lovett"))
53    (history
54      (version "3.001" "Bugfix for unbound")
55      (version "3.0" "Split into macro/procedure files, file renames. Incompatible!")
56      (version "2.9.3" "Added priority, termios, and winsize for Solaris. Patch for pty header file on BSD. [From Peter Bex]")
57      (version "2.9.2" "Deprecated chain-implicit-exit-handler - use library unit 'on-exit'. Replace which-command-directory with which-command-pathname. Removed make-program-pathname. Added ensure-list, file-exists/directory?, find-file-pathnames, find-program-pathnames")
58      (version "2.9.1" "Added create-directory/parents, make-program-filename, make-program-pathname. Removed pseudo-tty for Solaris.")
59      (version "2.9" "Added 'typecase' macro, pseudo-tty procedures.")
60      (version "2.8" "Removed 'define-structure'. Added srfi-12 api macros.")
61      (version "2.7" "Split -procs into -list, -sym, -control, -io, with -procs an umbrella. Added -srfi-12.")
62      (version "2.62" "Added which-command-directory.")
63      (version "2.61" "Added set!/op, removed set-op!, fix for shift!/set, errorf.")
64      (version "2.6" "Added priority routines to posix extension.")
65      (version "2.5" "Removed defined-symbol? & make-log-function, added alist-delete*, shift!/set, unzip-alist")
66      (version "2.4" "Bug fix for defined-symbol?")
67      (version "2.3" "Added undefined & unbound stuff")
68      (version "2.2" "Added 'chain-implicit-exit-handler'")
69      (version "2.1" "Added 'whennot', 'inc', 'dec','create-pathname-directory'")
70      (version "2.0" "Added 'define-inline-unchecked-record-type'")
71      (version "1.9" "Rename ++f* -> f*++, remove mu & nu; me stupid")
72      (version "1.8" "Moved procedures to own extension")
73      (version "1.7" "Exports, additions")
74      (version "1.6" "More stuff, rename fp++, etc -> ++fp")
75      (version "1.5" "Added alist-delete-first")
76      (version "1.4" "Added mu, nu, moved looping constructs to miscmacros")
77      (version "1.3" "Removed use of define-syntax")
78      (version "1.2" "Added assure, nl, rename set*! to stiff-set!, fp++, etc.")
79      (version "1.1" "Added plain repeat, assoc macros signal errors")
80      (version "1.0" "Initial release"))
81
82    (download "misc-extn.egg")
83
84    (documentation
85
86      (subsection "Record Types"
87
88        (usage "(require-extension misc-extn-record)")
89
90        (macro "(define-unchecked-record-type T CTOR PRED [SLOT ...])"
91          (p "SRFI-9 '(define-record-type T CTOR PRED [SLOT ...])', "
92          "except no checks are made for correct record type before slot "
93          "access, and the record type symbol is not defined.")
94
95          (p "For use when slot access is attempted " (i "only") " after "
96          "determining the correct record type explicitly. Do " (i "not") " "
97          "make constructed slot access procedures part of a public "
98          "API."))
99
100        (macro "(define-inline-unchecked-record-type T CTOR PRED [SLOT ...])"
101          (p "SRFI-9 '(define-record-type T CTOR PRED [SLOT ...])', "
102          "except no checks are made for correct record type before slot "
103          "access, the record type symbol is not defined, and  "
104          "procedures are inline.")
105
106          (p "For use when slot access is attempted " (i "only") " after "
107          "determining the correct record type explicitly."))
108      )
109
110      (subsection "Control Forms"
111
112        (usage "(require-extension misc-extn-control)")
113
114        (macro "(typecase EXPRESSION [(TYPE-TEST BODY ...) ...])"
115          (p "Expands into a " (code "cond") " form where every case test is a "
116          "type test.")
117
118          (p "A " (tt "TYPE-TEST") " is either a symbol, which must "
119          "be the base symbol of a type predicate, a non-null list, which must "
120          "be a list of the base symbols of type predicates, or the symbol "
121          (code "else") ". An example of a base symbol of a type predicate is "
122          (code "symbol") " and the procedure " (code "(symbol? OBJECT)") " "
123          "is used for the test.")
124
125          (p "The " (tt "BODY") " is not processed. It must be legal as the "
126          "body of a " (code "cond") " case.") )
127
128        (macro "(typecase* EXPRESSION [(TYPE-TEST BODY ...) ...])"
129          (p "Like " (code "typecase") " but binds local variable " (code "it") " "
130          "to the value of " (tt "EXPRESSION") ".") )
131
132        (macro "(whennot CONDITION [BODY ...])"
133          (p "Same as " (code "(unless CONDITION [BODY ...])") "."))
134
135        (macro "(swap-set! VAR1 VAR2)"
136          (p "Swap settings of " (tt "VAR1") " & " (tt "VAR2") "."))
137
138        (macro "(fluid-set! VAR VAL ...)"
139          (p "Set each variable " (tt "VAR") " to the value "
140          (tt "VAL") " in parallel."))
141
142        (macro "(stiff-set! VAR VAL ...)"
143          (p "Set each variable " (tt "VAR") " to the value "
144          (tt "VAL") " in series."))
145
146        (macro "(hash-let (([VAR | (VAR KEY)] ...) HASH-TABLE) BODY ...)"
147          (p "Decompose " (tt "HASH-TABLE") " entries into variable "
148          "bindings. Should the " (tt "KEY") " not be symbol, or the "
149          "desired variable name " (tt "VAR") " should not be the key, "
150          "the '(VAR KEY)' form can be used. The " (tt "BODY ...") " is "
151          "evaluated with the specified bindings."))
152
153        (macro "(set!/op VAR OP ARG ...)"
154          (p "Sets " (tt "VAR") " to the value of " (code "(OP ARG ...)") ", where "
155          "the first occurrence of " (code "<>") " in " (tt "ARG ...") " is "
156          "replaced with " (tt "VAR") ". When there is no occurrence of " (code "<>") " in " (tt "ARG ...")
157          "the template " (tt "(OP <> ARG ...)") " is used.") )
158
159        (procedure "(assure EXPRESSION [ERROR-ARGUMENT ...])"
160          (p "When " (tt "EXPRESSION") " yields " (code "#f") " invoke "
161          (code "(error ERROR-ARGUMENT ...)") ", otherwise return value."))
162
163        (procedure "(identify-error [CALLER] MSG ARGS ...)"
164          (p "Prints a message like " (tt "(error ...)") " to "
165          (tt "(current-error-port)") " but does not throw an exception."))
166
167        (procedure "(errorf [ID] [FORMAT-STRING ARGS ...])"
168          (p "Same as '(error [ID] (sprintf FORMAT-STRING ARGS ...))'.")
169
170          (p "The actual argument for the returned procedure is to be a "
171          "procedure which will be applied with the evaluated expressions "
172          "as the actual argument list."))
173      )
174
175      (subsection "Lists"
176
177        (usage "(require-extension misc-extn-list)")
178
179        (p "The length test macros terminate early when the test is satisfied; i.e they do not "
180        "use " (code "length") ".")
181
182        (macro "(length=0? LIST)"
183          (p "List of length zero?"))
184
185        (macro "(length=1? LIST)"
186          (p "List of length one?"))
187
188        (macro "(length=2? LIST)"
189          (p "List of length two?"))
190
191        (macro "(length>1? LIST)"
192          (p "List of length greater than one?"))
193
194        (macro "(shift!/set SYM [DEFAULT])"
195          (p "Like " (code "shift!") " in the utils unit but assigns the "
196          "variable " (tt "SYM") " the " (code "'()") " after shifting from a "
197          "list of length 1."))
198
199        (p "Error signaling versions of the standard association lookup functions. "
200        "When the " (tt "KEY") " is not found and a " (tt "DEFAULT") " is not supplied an "
201        (code "error") " is invoked.")
202
203        (macro "(assoc-def KEY ALIST [TEST] [DEFAULT])"
204          (p "The assoc procedure with an optional test and default "
205          "value."))
206
207        (macro "(assv-def KEY ALIST [DEFAULT])"
208          (p "The assv procedure with a default value."))
209
210        (macro "(assq-def KEY ALIST [DEFAULT])"
211          (p "The assq procedure with a default value."))
212
213        (procedure "(ensure-list OBJECT)"
214          (p "Returns a list, either the list " (tt "OBJECT") " or "
215          (code "(list OBJECT)") ".") )
216
217        (procedure "(not-null? LIST)"
218          (p "Returns " (code "#f") " if the given " (tt "LIST") " is empty, and "
219          (tt "LIST") " otherwise."))
220
221        (procedure "(filter-rest-argument! REST-LIST [PREDICATE | LIST-OF-KEYWORD])"
222          (p "Destructively remove any keywords & keyword+value items from a "
223          (code "#!rest") " argument list.")
224
225          (p "When the optional predicate is supplied it must return "
226          (code "#t") " or " (code "#f") " indicating whether the item "
227          "is to kept or removed. The predicate takes the current item.")
228
229          (p "When the optional keyword list is supplied only keywords & "
230          "keyword+value items from the list are removed."))
231
232        (procedure "(alist-inverse-ref VALUE ALIST [EQUALITY? eqv?] [DEFAULT #f])"
233          (p "Returns the first key associated with " (tt "VALUE") " in "
234          "the " (tt "ALIST") " using the " (tt "EQUALITY?") " predicate, "
235          "else " (tt "DEFAULT") "."))
236
237        (procedure "(alist-delete* KEY ALIST [COUNT [EQUALITY?]])"
238          (p "Deletes the first (tt "COUNT") associations from alist "
239          (tt "ALIST") "with the given key " (tt "KEY") ", using key-comparison "
240          "procedure " (tt "EQUALITY?") ". The dynamic order in which the "
241          "various applications of equality are made is from the alist "
242          "head to the tail.")
243
244          (p "Returns a new alist. The alist is not disordered - elements that appear "
245          "in the result alist occur in the same order as they occur in "
246          "the argument alist.")
247
248          (p "The equality procedure is used to compare the element "
249          "keys, 'key[i: 0 <= i < (length ALIST)]', of the alist's "
250          "entries to the key parameter in this way: '(EQUALITY? KEY "
251          "key[i])'.")
252
253          (p (tt "COUNT") " defaults to essentially, infinity, and " (tt "EQUALITY?")
254          " defaults to " (code "equal?") ".") )
255
256        (procedure "(alist-delete-first KEY ALIST [EQUALITY?])"
257          (p "Returns " (code "(alist-delete* KEY ALIST 1 [EQUALITY?])") ".") )
258
259        (procedure "(unzip-alist ALIST)"
260          (p "Returns 2 values, a list of the keys & a list of the values from
261          the " (tt "ALIST") ".") )
262      )
263
264      (subsection "Arithmetic"
265
266        (usage "(require-extension misc-extn-numeric)")
267
268        (macro "(inc VAL)"
269          (p "Read-only increment."))
270
271        (macro "(dec VAL)"
272          (p "Read-only decrement."))
273
274        (macro "(++ VAL)"
275          (p "Read-only increment."))
276
277        (macro "(-- VAL)"
278          (p "Read-only decrement."))
279
280        (macro "(fx++ VAL)"
281          (p "Read-only fixnum increment."))
282
283        (macro "(fx-- VAL)"
284          (p "Read-only fixnum decrement."))
285
286        (macro "(fp++ VAL)"
287          (p "Read-only flonum increment."))
288
289        (macro "(fp-- VAL)"
290          (p "Read-only flonum decrement."))
291
292        (macro "(++! VAR)"
293          (p "Mutable increment."))
294
295        (macro "(--! VAR)"
296          (p "Mutable decrement."))
297
298        (macro "(fx++! VAR)"
299          (p "Mutable fixnum increment."))
300
301        (macro "(fx--! VAR)"
302          (p "Mutable fixnum decrement."))
303
304        (macro "(fp++! VAR)"
305          (p "Mutable flonum increment."))
306
307        (macro "(fp--! VAR)"
308          (p "Mutable flonum decrement."))
309      )
310
311      (subsection "Posix"
312
313        (usage "(require-extension misc-extn-posix)")
314
315        (procedure "(replace-fileno NEW-FILENO KNOWN-FILENO)"
316          (p "Replaces the meaning of " (tt "KNOWN-FILENO") " with "
317          (tt "NEW-FILENO") ". I/O Redirection.") )
318
319        (procedure "(create-directory/parents DIRECTORY)"
320          (p "Ensures the directory pathname " (tt "DIRECTORY") " exists.")
321
322          (p "Like the UNIX `\"mkdir -p DIRECTORY\" command.") )
323
324        (procedure "(create-pathname-directory PATHNAME)"
325          (p "Ensures the directory component of " (tt "PATHNAME") " exist.")
326
327          (p "Like the UNIX `\"mkdir -p `dirname PATHNAME`\" command.") )
328
329        (procedure "(make-program-filename COMMAND)"
330          (p "Returns the platform specific form of an executable command "
331          "filename.")
332
333          (p "On Windows the " (code "exe") " extension is added unless an "
334          "extension is already present. Does nothing on other platforms.") )
335
336        (procedure "(file-exists/directory? FILENAME [DIRECTORY | DIRECTORY-LIST])"
337          (p "Returns the pathname when " (tt "FILENAME") " exists in the "
338          (tt "DIRECTORY") ", otherwise " (code "#f") ".")
339
340          (p (tt "DIRECTORY-LIST") " is as for " (code "make-pathname") ".")
341
342          (p "When only the " (tt "FILENAME") " parameter supplied then the "
343          "same as " (code "file-exists?") ".") )
344
345        (procedure "(find-file-pathnames FILENAME [DIRECTORY | DIRECTORY-LIST] ...)"
346          (p "Returns a list of all pathnames found for " (tt "FILENAME") " in "
347          "the supplied directory/directories, or " (code "#f") " when not found.")
348
349          (p "The list of pathnames is in the same relative order as that of "
350          "the directory parameter(s).") )
351
352        (procedure "(find-program-pathnames COMMAND-NAME [DIRECTORY | DIRECTORY-LIST] ...)"
353          (p "Returns a list of all pathnames found for " (tt "COMMAND-NAME") " in "
354          "the supplied directory/directories, or " (code "#f") " when not found.")
355
356          (p "Uses " (code "make-program-filename") " to make a filename.")
357
358          (p "Does not ensure that the file is executable!") )
359
360        (procedure "(which-command-pathname COMMAND-NAME [ENVIRONMENT-VARIABLE "PATH"])"
361          (p "Returns the first directory in the " (tt "ENVIRONMENT-VARIABLE") " "
362          "where a file named " (tt "COMMAND-NAME") " exists, "
363          "or " (code "#f") " when nothing found.")
364
365          (p "Uses the platform specific PATH environment variable element "
366          "separator - a semi-colon for Windows, & a colon otherwise.")
367
368          (p "Like the UNIX \"which COMMAND-NAME\" command.") )
369
370        (procedure "(remove-dotfiles FILES)"
371          (p "Remove dot files from a directory list. Useful with " (code "glob") "."))
372
373                                (subsubsection "Scheduling Priority"
374
375          (p "Parameter Descriptions")
376          (symbol-table
377            (describe priority/process
378              "Process WHICH - WHO is 0 for current process or a process identifier.")
379            (describe priority/process-group
380              "Process Group WHICH - WHO is 0 for current process group or a process group identifier.")
381            (describe priority/user
382              "User WHICH - WHO is 0 for current user or a user identifier.")
383            (describe PRIORITY
384              "An integer [-20 20].") )
385          (br)
386
387          (procedure "(scheduling-priority WHICH WHO)"
388            (p "Returns the priority of " (tt "WHO") " of kind " (tt "WHICH") ".") )
389
390          (procedure "(set-scheduling-priority! WHICH WHO PRIORITY)"
391            (p "Sets the priority of " (tt "WHO") " of kind " (tt "WHICH") " to "
392            (tt "PRIORITY") ".") )
393        )
394
395                                (subsubsection "Pseudo-TTY"
396
397          (p "Currently a thin wrapper around the C interface. Scheme bindings "
398          "for the necessary C constants are not provided.")
399
400          (procedure "(alloc-winsize)"
401            (p "Returns the pointer to a new C struct winsize.") )
402
403          (procedure "(free-winsize (nonnull-pointer WINSIZE))"
404            (p "Releases a C struct winsize.") )
405
406          (p "Accessors for a struct winsize")
407          (symbol-table
408            (describe winsize-col "Returns ws_col")
409            (describe winsize-col-set! "Sets ws_col")
410            (describe winsize-row "Returns ws_row")
411            (describe winsize-row-set! "Sets ws_row")
412            (describe winsize-xpixel "Returns ws_xpixel")
413            (describe winsize-xpixel-set! "Sets ws_xpixel")
414            (describe winsize-ypixel "Returns ws_ypixel")
415            (describe winsize-ypixel-set! "Sets ws_ypixel") )
416          (br)
417
418          (procedure "(alloc-termios)"
419            (p "Returns the pointer to a new C struct termios.") )
420
421          (procedure "(free-termios (nonnull-pointer TERMIOS))"
422            (p "Releases a C struct termios.") )
423
424          (p "Accessors for a struct termios")
425          (symbol-table
426            (describe termios-cc "Returns c_cc[idx]")
427            (describe termios-cc-set! "Sets c_cc[idx]")
428            (describe termios-cflag "Returns c_cflag")
429            (describe termios-cflag-set! "Sets c_cflag")
430            (describe termios-iflag "Returns c_iflag")
431            (describe termios-iflag-set! "Sets c_iflag")
432            (describe termios-lflag "Returns c_lflag")
433            (describe termios-lflag-set! "Sets c_lflag")
434            (describe termios-oflag "Returns c_oflag")
435            (describe termios-oflag-set! "Sets c_oflag")
436            (describe termios-ispeed "Returns c_ispeed")
437            (describe termios-ispeed-set! "Sets c_ispeed")
438            (describe termios-ospeed "Returns c_ospeed")
439            (describe termios-ospeed-set! "Sets c_ospeed") )
440          (br)
441
442          (procedure "(login-tty SLAVE-FILENO)"
443            (p "The C procedure.") )
444
445          (procedure "(open-pty (nonnull-pointer MASTER-FILENO) (nonnull-pointer SLAVE-FILENO) (c-string NAME) (pointer WINSIZE) (pointer TERMIOS))"
446            (p "The C procedure.") )
447        )
448      )
449
450      (subsection "Symbol"
451
452        (usage "(require-extension misc-extn-symbol)")
453
454        (macro "(unbound-value)"
455          (p "Returns the value representing \"unbound\".") )
456
457        (macro "(unbound-value? OBJECT)"
458          (p "Is the " (tt "OBJECT") " the unbound value?") )
459
460        (macro "(unbound? SYMBOL)"
461          (p "Is the " (tt "SYMBOL") " unbound? " (tt "SYMBOL") " is unquoted!") )
462
463        (macro "(symbol-value SYMBOL [DEFAULT #f])"
464          (p "Returns the " (tt "SYMBOL") " binding when bound, "
465          "otherwise the " (tt "DEFAULT") ". " (tt "SYMBOL") " is unquoted!") )
466
467        (macro "(undefined-value)"
468          (p "Returns the value representing \"undefined\".") )
469
470        (macro "(undefined-value? OBJECT)"
471          (p "Is the " (tt "OBJECT") " the undefined value?") )
472
473        (macro "(undefined? OBJECT)"
474          (p "Is the " (tt "OBJECT") " the undefined value?") )
475
476        (procedure "(make-qualified-symbol NAMESPACE SYMBOL)"
477          (p "Returns the Chicken namespace qualified " (tt "SYMBOL") " for the "
478          (tt "NAMESPACE") ".")
479
480          (p "An exception is generated when the " (tt "NAMESPACE") " "
481          "length exceeds the system limit.") )
482
483        (procedure "(make-qualified-uninterned-symbol NAMESPACE SYMBOL)"
484          (p "Returns the Chicken namespace qualified " (tt "SYMBOL") " for the "
485          (tt "NAMESPACE") ".") )
486
487        (procedure "(qualified-symbol? SYMBOL)"
488          (p "Is the " (tt "SYMBOL") " a Chicken namespace qualified symbol."))
489
490        (procedure "(symbol->qualified-string SYMBOL)"
491          (p "Returns the printname of a Chicken namespace qualified " (tt "SYMBOL") "."))
492
493        (procedure "(interned-symbol? SYMBOL)"
494          (p "Is the " (tt "SYMBOL") " interned?"))
495      )
496
497      (subsection "Conditions"
498
499        (usage "(require-extension misc-extn-condition)")
500
501        (p "The build condition API macros are currently " (b "unavailable") " when using "
502        (b "hygienic") " macros.")
503
504        (macro "(build-condition-naming-API FORM ...)"
505          (p "Expands into one or more macros that expand into a condition specification "
506          "form, suitable for use with " (code "build-property-condition-API") " and "
507          (code "build-composite-condition-API") ".")
508
509          (p "Example: "
510          (code "(build-condition-naming (exn location message arguments) foo (bar rope))"))
511
512          (p "Creates the following:")
513
514          (ul
515            (li (code "(define-macro (exn-condition) '(exn location message arguments))") )
516            (li (code "(define-macro (foo-condition) 'foo)") )
517            (li (code "(define-macro (bar-condition) '(bar rope))") ) ) )
518
519        (macro "(build-property-condition-API FORM ...)"
520          (p "Expands into a suite of procedures to construct and test SRFI-12 property "
521          "condition objects.")
522
523          (p "When only one " (tt "FORM") " is supplied a single property condition API is "
524          "built. When more than one " (tt "FORM") " are supplied then all the property "
525          "condition APIs are built.")
526
527          (p "When " (tt "FORM") " is a symbol it is a condition " (tt "KIND-KEY") " and "
528          "identifies a condition without properties. When " (tt "FORM") " is a list the first "
529          "element is the condition " (tt "KIND-KEY") " and the following elements are property "
530          "keys.")
531
532          (p "A condition constructor is named as " (tt "make-KIND-KEY-condition") " "
533          "and has 0 or more formal parameters, which are the property keys.")
534
535          (p "A condition predicate is named as " (tt "KIND-KEY-condition?") " "
536          "and has 1 formal parameter, the object to test.")
537
538          (p "Property condition constructors without properties always return the same "
539          "condition object!")
540
541          (p "Example: "
542          (code "(build-property-condition-API (exn location message arguments) foo (bar rope))"))
543
544          (p "Creates the following:")
545
546          (ul
547            (li (code "(make-exn-condition location message arguments)"))
548            (li (code "(exn-condition? object)") )
549            (li (code "(make-foo-condition)") )
550            (li (code "(foo-condition? object)") )
551            (li (code "(make-bar-condition rope)") )
552            (li (code "(bar-condition? object)") ) ) )
553
554        (macro "(build-composite-condition-API FORM ...)"
555          (p "Expands into a suite of procedures to construct and test SRFI-12 a composite "
556          "condition object.")
557
558          (p (tt "FORM") " is the same as " (tt "FORM") " in the "
559          (code "build-property-condition-API") " definition.")
560
561          (p "When zero or one " (tt "FORM") " are supplied nothing is built. When more than "
562          "one " (tt "FORM") " are supplied then a composite API is built.")
563
564          (p "A composite condition constructor is like a property condition constructor, "
565           "except that the " (tt "KIND-KEY") " is a concatenation of every condition "
566           (tt "KEY") ", interspersed with a hyphen.")
567
568          (p "A composite condition predicate is like a property condition predicate, "
569           "except that the " (tt "KIND-KEY") " is a concatenation of every condition "
570           (tt "KEY") ", interspersed with a hyphen.")
571
572          (p "Example: "
573          (code "(build-composite-condition-API (exn location message arguments) foo (bar rope))"))
574
575          (p "Creates the following:")
576
577          (ul
578            (li (code "(make-exn-foo-bar-condition location message arguments rope)") )
579            (li (code "(exn-foo-bar-condition? object)") ) ) )
580
581        (procedure "(handle-condition THUNK [HANDLER identity])"
582          (p "Simplified " (code "with-exception-handler") " where the "
583          (tt "HANDLER") " result is always returned to the caller.")
584
585          (p (tt "HANDLER") " is (-> condition object).") )
586
587        (procedure "(composite-condition? OBJECT [KIND-KEY ...])"
588          (p "Is the " (tt "OBJECT") " a SRFI-12 composite condition?")
589
590          (p "When one or more " (tt "KIND-KEY") " are supplied then the composite condition "
591          "must compose at least those kind keys.") )
592
593        (procedure "(condition-kind-keys CONDITION)"
594          (p "Returns a list of the kind-keys of the SRFI-12 "
595          (tt "CONDITION") ".") )
596
597        (procedure "(condition-property-keys CONDITION [KIND-KEY])"
598          (p "Returns a list of the property-keys for " (tt "KIND-KEY") " "
599          "of the SRFI-12 " (tt "CONDITION") ", or " (code "#f") " when no "
600          "property keys or the " (tt "CONDITION") " is not of the kind "
601          (tt "KIND-KEY") ".")
602
603          (p "When " (tt "KIND-KEY") " is missing some kind-key of the "
604          (tt "CONDITION") " is used.") )
605
606        (procedure "(condition-properties CONDITION [KIND-KEY])"
607          (p "Returns an association list of the property keys & values "
608          "for " (tt "KIND-KEY") " of the SRFI-12 " (tt "CONDITION")
609          ", or " (code "#f") " when no " "property keys or the "
610          (tt "CONDITION") " is not of the kind " (tt "KIND-KEY") ".")
611
612          (p "When " (tt "KIND-KEY") " is missing some kind-key of the "
613          (tt "CONDITION") " is used.") )
614
615        (procedure "(condition-explode CONDITION)"
616          (p "Returns an association list of every kind-key of the "
617          "SRFI-12 " (tt "CONDITION") ". The value of each entry is the "
618          "result of " (code "(condition-properties CONDITION KIND-KEY") " "
619          "for that " (tt "KIND-KEY") ".") )
620
621        (procedure "(make-property-condition/list KIND-LIST PROPERTY-LIST)"
622          (p "Returns a new condition.")
623
624          (p (tt "KIND-LIST") " is a list of kind-key.")
625
626          (p (tt "PROPERTY-LIST") " is a property list, where the key "
627          "element is a pair, (<kind-key> . <property-key>).") )
628      )
629
630      (subsection "Input/Output"
631
632        (usage "(require-extension misc-extn-io)")
633
634        (procedure "(cout EXPR ...)"
635          (p "Like cout << arguments << args where argument can be any "
636          "Scheme object. If it's a procedure (without args) it's "
637          "executed rather than printed (like newline)."))
638
639        (procedure "(cerr EXPR ...)"
640          (p "Like cerr << arguments << args where argument can be any "
641          "Scheme object. If it's a procedure (without args) it's "
642          "executed rather than printed (like newline)."))
643
644        (constant "nl"
645          (p "String form of the newline character."))
646      )
647     )
648
649    (section "Contributions"
650
651      (p "William Annis - hash-let.")
652
653      (p "Oleg Kiselyov's Standard Scheme \"Prelude\" - ++, ...")
654    )
655
656    (examples ,examples)
657
658    (section "License" (pre ,license))
659  )
660))
661
662(eggdoc->html doc
663  `(,@(eggdoc:make-stylesheet doc)
664    (constant *macro* . ,eggdoc:make-defsig)))
Note: See TracBrowser for help on using the repository browser.