[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-81-g831e67

From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-81-g831e678
Date: Tue, 08 Mar 2011 21:34:56 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

The branch, stable-2.0 has been updated
       via  831e6782bfa776c30286ef14f1356b9d5aa8f1ee (commit)
      from  c2e56d9b0727d50a90917ea6b79f17ebe2d35c98 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 831e6782bfa776c30286ef14f1356b9d5aa8f1ee
Author: Andy Wingo <address@hidden>
Date:   Tue Mar 8 22:34:53 2011 +0100

    scm_public_ref et al docs
    * doc/ref/api-modules.texi (Accessing Modules from C): Add docs for the
      new C procedures.


Summary of changes:
 doc/ref/api-modules.texi |   65 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 64 insertions(+), 1 deletions(-)

diff --git a/doc/ref/api-modules.texi b/doc/ref/api-modules.texi
index e0c10ae..3feced4 100644
--- a/doc/ref/api-modules.texi
+++ b/doc/ref/api-modules.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 
2008, 2009, 2010
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 
2008, 2009, 2010, 2011
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
@@ -935,6 +935,62 @@ value of @code{scm_c_call_with_current_module} is the 
return value of
 @end deftypefn
address@hidden SCM scm_public_variable (SCM @var{module_name}, SCM @var{name})
address@hidden SCM scm_c_public_variable (const char * @var{module_name}, const 
char * @var{name})
+Find a the variable bound to the symbol @var{name} in the public
+interface of the module named @var{module_name}.
+ @var{module_name} should be a list of symbols, when represented as a
+Scheme object, or a space-separated string, in the @code{const char *}
+case.  See @code{scm_c_define_module} below, for more examples.
+Signals an error if no module was found with the given name.  If
address@hidden is not bound in the module, just returns @code{#f}.
address@hidden deftypefn
address@hidden SCM scm_private_variable (SCM @var{module_name}, SCM @var{name})
address@hidden SCM scm_c_private_variable (const char * @var{module_name}, 
const char * @var{name})
+Like @code{scm_public_variable}, but looks in the internals of the
+module named @var{module_name} instead of the public interface.
+Logically, these procedures should only be called on modules you write.
address@hidden deftypefn
address@hidden SCM scm_public_lookup (SCM @var{module_name}, SCM @var{name})
address@hidden SCM scm_c_public_lookup (const char * @var{module_name}, const 
char * @var{name})
address@hidden SCM scm_private_lookup (SCM @var{module_name}, SCM @var{name})
address@hidden SCM scm_c_private_lookup (const char * @var{module_name}, const 
char * @var{name})
+Like @code{scm_public_variable} or @code{scm_private_variable}, but if
+the @var{name} is not bound in the module, signals an error.  Returns a
+variable, always.
+SCM my_eval_string (SCM str)
+  static SCM eval_string_var = SCM_BOOL_F;
+  if (scm_is_false (eval_string_var))
+    eval_string_var =
+      scm_c_public_lookup ("ice-9 eval-string", "eval-string");
+  return scm_call_1 (scm_variable_ref (eval_string_var), str);
address@hidden example
address@hidden deftypefn
address@hidden SCM scm_public_ref (SCM @var{module_name}, SCM @var{name})
address@hidden SCM scm_c_public_ref (const char * @var{module_name}, const char 
* @var{name})
address@hidden SCM scm_private_ref (SCM @var{module_name}, SCM @var{name})
address@hidden SCM scm_c_private_ref (const char * @var{module_name}, const 
char * @var{name})
+Like @code{scm_public_lookup} or @code{scm_private_lookup}, but
+additionally dereferences the variable.  If the variable object is
+unbound, signals an error.  Returns the value bound to @var{name} in
address@hidden deftypefn
+In addition, there are a number of other lookup-related procedures.  We
+suggest that you use the @code{scm_public_} and @code{scm_private_}
+family of procedures instead, if possible.
 @deftypefn {C Procedure} SCM scm_c_lookup (const char address@hidden)
 Return the variable bound to the symbol indicated by @var{name} in the
 current module.  If there is no such binding or the symbol is not
@@ -951,6 +1007,13 @@ Like @code{scm_c_lookup} and @code{scm_lookup}, but the 
 module is used instead of the current one.
 @end deftypefn
address@hidden {C Procedure} SCM scm_module_variable (SCM @var{module}, SCM 
+Like @code{scm_module_lookup}, but if the binding does not exist, just
+returns @code{#f} instead of raising an error.
address@hidden deftypefn
+To define a value, use @code{scm_define}:
 @deftypefn {C Procedure} SCM scm_c_define (const char address@hidden, SCM 
 Bind the symbol indicated by @var{name} to a variable in the current
 module and set that variable to @var{val}.  When @var{name} is already

GNU Guile

reply via email to

[Prev in Thread] Current Thread [Next in Thread]