[cl-pdf-devel] Better arglists for pdf:with-document, tt:paragraph, etc.

Pixel // pinterface pinterface at gmail.com
Mon Apr 19 04:53:24 UTC 2010


Do you find it difficult to use cl-pdf or cl-typesetting with limited &rest
lambda lists?  Do the autodoc hints in slime prove unhelpful?  Do you wish
you could type "(with-document " or "(paragraph " and get an accurate
listing of what arguments are available?  Do you use SBCL or Clisp?[1]

Then have I got the .asd for you!

Introducing cl-pdf.arglists: better arglists for cl-pdf and cl-typesetting
macros.
  http://web.kepibu.org/code/lisp/cl-pdf.arglists/

Turns
  (with-document (&rest args
                  &key (max-number-of-pages 'pdf:*max-number-of-pages*)
                  &allow-other-keys)
                 &body body)
into
  (with-document (&rest args
                  &key (max-number-of-pages 'pdf:*max-number-of-pages*)
                  empty mode layout (creator "") author title subject
                  keywords &allow-other-keys)
                 &body body)
and
 (paragraph (&rest style) &body body)
into
 (paragraph (&rest style
             &key font font-size text-x-scale color
             background-color h-align left-margin right-margin
             pre-decoration post-decoration leading-ratio)
            &body body)

Wow!

But wait, there's more!

Act now, and we'll include at no additional cost:
* Keyword arguments from object initargs
* Keyword arguments from initialize-instance
* To-the-macroexpansion accuracy through the magic of introspection

That's an arbitrary-dollar-amount value for only $0!  That's a savings of
<division-by-zero>%!


[1] Patches for other implementations welcome!

-pix
If only I'd written this /before/ largely finishing my cl-pdf-using program.
:)







More information about the cl-pdf-devel mailing list