;;; -*- mode: scheme48; package: (config) -*- ;;;;;; Fake interface documentation wrapper macro ;;; This code is written by Taylor Campbell and placed in the Public ;;; Domain. All warranties are disclaimed. ;;; Non-implementation of proposed interface documentation system. ;;; Example: ;;; ;;; (define-documented-interface filenames ;;; "Miscellaneous filename utilities." ;;; (export ((NAMESTRING namelist directory default-type) :string ;;; "Returns the namestring representation of NAMELIST, ;;; relative to DIRECTORY if it is supplied non-#F, and ;;; with a file type of DEFAULT-TYPE if DEFAULT-TYPE is ;;; supplied as non-#F and the namelist does not specify ;;; a type.") ;;; ...)) (define-syntax define-documented-interface (syntax-rules (EXPORT) ((DEFINE-DOCUMENTED-INTERFACE name interface-doc (EXPORT export-spec ...)) (DEFINE-INTERFACE name (PROCESS-DOCUMENTED-EXPORTS () export-spec ...))) ((DEFINE-DOCUMENTED-INTERFACE name interface-doc exp) (DEFINE-INTERFACE name exp)))) (define-syntax process-documented-exports (syntax-rules (:SYNTAX) ((PROCESS-DOCUMENTED-EXPORTS exports) (EXPORT . exports)) ((PROCESS-DOCUMENTED-EXPORTS exports (name :SYNTAX doc) more ...) (PROCESS-DOCUMENTED-EXPORTS ((name :SYNTAX) . exports) more ...)) ((PROCESS-DOCUMENTED-EXPORTS exports ((name . args) doc) more ...) (PROCESS-DOCUMENTED-EXPORTS ((name :PROCEDURE) . exports) more ...)) ((PROCESS-DOCUMENTED-EXPORTS exports ((name . args) rettype doc) more ...) (PROCESS-DOCUMENTED-EXPORTS exports ((name . args) doc) more ...)) ((PROCESS-DOCUMENTED-EXPORTS exports (name type doc) more ...) (PROCESS-DOCUMENTED-EXPORTS (name . exports) more ...))))