X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/df28942de116d6b194f0f2aee3cf20450d5e44aa..d27fd5f3469dc5e39711b8a2d94568b8a9741e5e:/doc/list-exports diff --git a/doc/list-exports b/doc/list-exports index 3a444e1..9fc38bb 100755 --- a/doc/list-exports +++ b/doc/list-exports @@ -159,6 +159,42 @@ (and export (list* (symbolicate 'c-type- (car names)) names))))) +(defmethod form-list-exports + ((head (eql 'sod::define-cross-product-types)) tail) + "Return the symbols exported by a `define-cross-product-types' form. + + This is a scummy internal macro in `c-types-impl.lisp'. The syntax is + + (define-cross-product-types PIECES) + + Each piece can be a list of strings, or an atomic string (which is + equivalent to a list containing just that string). For each string formed + by concatenating one element from each list in order, define a C type with + that name; the Lisp name is constructed by translating the letters to + uppercase and replacing underscores by hyphens. For each such name, + export `NAME' and `c-type-NAME'." + + ;; Huh. I feel a hack coming on. + (mapcar (lambda (row) + (intern (with-output-to-string (out) + (dolist (s row) + (dotimes (i (length s)) + (let ((ch (char s i))) + (if (char= ch #\_) + (write-char #\- out) + (write-char (char-upcase ch) out)))))))) + (reduce (lambda (piece tails) + (mapcan (lambda (tail) + (mapcar (lambda (head) + (cons head tail)) + (if (listp piece) piece + (list piece)))) + tails)) + (cons '("" "c-type_") tail) + :from-end t + :initial-value '(nil)))) + + (defmethod form-list-exports ((head (eql 'cl:macrolet)) tail) "Return the symbols expored by a toplevel `macrolet' form.