Xorn
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
guile.py
Go to the documentation of this file.
1 # Copyright (C) 2013-2016 Roland Lutz
2 #
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.
7 #
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.
12 #
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.
16 
17 ## \file xorn/guile.py
18 ## Placeholder file for xorn.guile documentation.
19 #
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/.
24 
25 ## \namespace xorn.guile
26 ## Embedding a Guile interpreter.
27 #
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:
32 #
33 # \snippet guile.py guile
34 
35 ## Raised on Guile-related errors.
36 
37 class GuileError(Exception):
38  pass
39 
40 ## Guile procedure.
41 #
42 # This type can't be directly instantiated.
43 
44 class Procedure(object):
45  ## x.__call__(...) <==> x(...)
46  def __call__(...):
47  pass
48 
49  ## x.__repr__() <==> repr(x)
50  def __repr__(...):
51  pass
52 
53 ## Return the variable bound to a symbol.
54 #
55 # Signals an error if there is no such binding or the symbol is not
56 # bound to a variable.
57 
58 def lookup(name):
59  pass
60 
61 ## Create a top level variable.
62 #
63 # If the named variable already exists, just changes its value.
64 #
65 # \throws GuileError if \a value can't be represented as a Guile
66 # object
67 
68 def define(name, value):
69  pass
70 
71 ## Load a file and evaluate its contents in the top-level environment.
72 #
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.
77 #
78 # \sa [Guile documentation for %%load-hook](https://www.gnu.org/
79 #software/guile/manual/html_node/Loading.html#index-_0025load_002dhook)
80 
81 def load(name):
82  pass
83 
84 ## Parse a string as Scheme and evaluate the expressions it contains,
85 ## in order, returning the last expression.
86 
87 def eval_string(string):
88  pass
Guile procedure.
Definition: guile.py:44
def load
Load a file and evaluate its contents in the top-level environment.
Definition: guile.py:81
def __call__
x.__call__(...) <==> x(...)
Definition: guile.py:46
def __repr__
x.__repr__() <==> repr(x)
Definition: guile.py:50
def eval_string
Parse a string as Scheme and evaluate the expressions it contains, in order, returning the last expre...
Definition: guile.py:87
Raised on Guile-related errors.
Definition: guile.py:37
def lookup
Return the variable bound to a symbol.
Definition: guile.py:58
def define
Create a top level variable.
Definition: guile.py:68