Merge fixes from branch 'xorn'
[geda-gaf.git] / xorn / src / python / guile.py
blob68d6185df5f0d06feec9d736dc74770616fc6dec
1 # Copyright (C) 2013-2020 Roland Lutz
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 ## \file xorn/guile.py
18 ## Placeholder file for xorn.guile documentation.
20 # This file DOES NOT contain the actual source code of the xorn.guile
21 # module. It contains documented stubs of the code from which the
22 # Doxygen documentation is generated. For the actual definition of
23 # the module, see the Python extension in \c src/cpython/guile/.
25 ## \namespace xorn.guile
26 ## Embedding a Guile interpreter.
28 # This module allows embedding a Guile interpreter into a Python
29 # application. It translates Python objects transparently into Guile
30 # objects and vice versa. In order to make a Python function
31 # available to Guile code, just bind it to a variable name:
33 # \snippet guile.py guile
35 ## Raised on Guile-related errors.
37 class GuileError(Exception):
38 pass
40 ## Guile procedure.
42 # This type can't be directly instantiated.
44 class Procedure(object):
45 ## x.__call__(...) <==> x(...)
46 def __call__(...):
47 pass
49 ## x.__repr__() <==> repr(x)
50 def __repr__(...):
51 pass
53 ## Return the variable bound to a symbol.
55 # Signals an error if there is no such binding or the symbol is not
56 # bound to a variable.
58 def lookup(name):
59 pass
61 ## Create a top level variable.
63 # If the named variable already exists, just changes its value.
65 # \throws GuileError if \a value can't be represented as a Guile
66 # object
68 def define(name, value):
69 pass
71 ## Load a file and evaluate its contents in the top-level environment.
73 # \a name must either be a full pathname or be a pathname relative to
74 # the current directory. If the Guile variable \c %%load-hook is
75 # defined, the procedure to which it is bound will be called before
76 # any code is loaded.
78 # \sa [Guile documentation for %%load-hook](https://www.gnu.org/
79 #software/guile/manual/html_node/Loading.html#index-_0025load_002dhook)
81 def load(name):
82 pass
84 ## Parse a string as Scheme and evaluate the expressions it contains,
85 ## in order, returning the last expression.
87 def eval_string(string):
88 pass