(use eggdoc) (define doc `((eggdoc:begin (name "pyffi") (description "An interface to the Python programming language.") (author (url "http://chicken.wiki.br/users/ivan-raikov" "Ivan Raikov")) (history (version "2.11" "Ported to Chicken 4") (version "2.10" "Fixes in utf8 support") (version "2.9" "Added support for automatic conversion of Python class instances to Scheme alists") (version "2.8" "Bug fixes in Python FFI function declarations") (version "2.7" "Bug fixes in the Python unicode string conversion routine") (version "2.6" "define-pyslot updated to support modifying attributes") (version "2.5" "Added definitions for Py_IncRef and Py_DecRef when using Python 2.3") (version "2.4" "Fixed a bug in the wrapper of PyRun_String") (version "2.3" "Added support for the boolean type") (version "2.2" "Some fixes to ensure compatibility with Python 2.3 and 2.5") (version "2.1" "Build script updated for better cross-platform compatibility") (version "2.0" "Change to use utf8 extension") (version "1.1" "Metafile fix") (version "1.0" "Initial release")) (requires (url "utf8.html" "utf8") (url "easyffi.html" "easyffi")) (usage "(require-extension pyffi)") (download "pyffi.egg") (documentation (p "The " (tt "pyffi") " extension uses the " (url "http://www.python.org" "Python") " C interface " " to invoke Python procedures and methods from within Scheme " " and to convert data objects between their Python and Scheme " "representation. ") (p "Currently, " (tt "pyffi") " supports the Python data " "types listed in the table below. All other Python data types " "are represented as pointers. ") (symbol-table (describe "int, float" ("numeric types, converted to and from the corresponding Scheme numeric values.")) (describe "list" ("list type, converted to and from Scheme list value")) (describe "str" ("string type, converted to and from Scheme string value")) (describe "unicode" ("Unicode string type, converted to and from Scheme " (url "utf8.html" "utf8") " string")) (describe "dict" ("dictionary type, converted to and from Scheme alist value")) (describe "instance" ("class instance type, converted to Scheme alist value")) (describe "tuple" ("tuple type, converted to and from Scheme vector value"))) (subsection "Procedures" (procedure "(py-start)" (p "Initializes the Python interpreter, and creates an evaluation environment. " "This procedure must be called before all other procedures in the extension. ")) (procedure "(py-stop)" (p "Deallocates the memory reserved by the Python interpreter, and frees all " "internal structures of the extension. ")) (procedure "(py-import name)" (p "Imports Python module " (tt "NAME") ". If the import was unsuccessful, " "raises an exception of type " (tt "'pyerror") ". ")) (procedure "(py-eval expr)" (p "Evaluates the Python expression contained in the string " (tt "EXPR") " and returns the resulting value, either converted to Scheme " "representation, or as a pointer to a Python value. ")) (procedure "(py-apply func arg1 ...)" (p "Applies the given arguments to the Python object " (tt "FUNC") " and returns the resulting value, either converted to Scheme " "representation, or as a pointer to a Python value. " "The arguments must be either Scheme values of types listed " "in the type conversion table above, or pointers to Python values."))) (subsection "Macros" (macro "(define-pyfun expr arg1 ...)" (p "Defines a Scheme procedure named when called, " "invokes the Python procedure of the same name. " (tt "EXPR") " is either a string that contains the procedure name, " "or a pair of the form " (tt "(FORM . NAME)") " where " (tt "FORM") " is a Python expression that when evaluated returns a Python procedure, " "and " (tt "NAME") " is a string that contains the name of the Scheme procedure. " "The arguments must be all symbols. ")) (macro "(define-pyslot NAME [SCHEME-NAME])" (p "Defines an accessor/modifier for the Python object attribute " (tt "NAME") ". " "The optional argument " (tt "SCHEME-NAME") " is an alternate name for the " "Scheme procedure. The returned procedure takes in a Python object " "and returns the value of attribute " (tt "NAME") " contained in that object. " "If the object has no such attribute, #f is returned. " "If a value is supplied after the name of the object, the procedure acts as a modifier for that slot. " )) (macro "(define-pymethod NAME [SCHEME-NAME])" (p "Defines an accessor for the Python method " (tt "NAME") ". " "The optional argument " (tt "SCHEME-NAME") " is an alternate name for the " "Scheme procedure. The accessor is a procedure of the form " (tt "LAMBDA OBJ ARG1 ...") " that takes in a Python object " (tt "OBJ") " and invokes the method " (tt "NAME") " contained in that object, " "with the supplied arguments, which must be either Scheme values of types " "listed in the type conversion table above, or pointers to Python values. " "If the object has no such method, #f is returned. ")))) (examples (pre #<.")))) (if (eggdoc->html doc) (void))