(index ("py-start" 0) ("py-stop" 208) ("py-import" 374) ("py-eval" 558) ("py-apply" 801) ("define-pyfun" 1173) ("define-pyslot" 1666) ("define-pymethod" 2198))
(def (sig (procedure "(py-start)" (id py-start))) (p "Initializes the Python interpreter, and creates an evaluation environment. This procedure must be called before all other procedures in the extension."))
(def (sig (procedure "(py-stop)" (id py-stop))) (p "Deallocates the memory reserved by the Python interpreter, and frees all internal structures of the extension."))
(def (sig (procedure "(py-import name)" (id py-import))) (p "Imports Python module " (tt "NAME") ". If the import was unsuccessful, raises an exception of type " (tt "'pyerror") "."))
(def (sig (procedure "(py-eval expr)" (id py-eval))) (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."))
(def (sig (procedure "(py-apply func arg1 ...)" (id py-apply))) (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."))
(def (sig (syntax "(define-pyfun expr arg1 ...)" (id define-pyfun))) (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."))
(def (sig (syntax "(define-pyslot NAME [SCHEME-NAME])" (id define-pyslot))) (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."))
(def (sig (syntax "(define-pymethod NAME [SCHEME-NAME: NAME] [KW: NAME-LIST])" (id define-pymethod))) (p "Defines an accessor for the Python method " (tt "NAME") ". The optional keyword argument " (tt "SCHEME-NAME") " is an alternate name for the Scheme procedure. The optional keyword argument " (tt "KW") " is a list of keyword argument names for the Python method. 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."))
