summaryrefslogtreecommitdiff
path: root/examples/box-dynamic/README
diff options
context:
space:
mode:
Diffstat (limited to 'examples/box-dynamic/README')
-rw-r--r--examples/box-dynamic/README25
1 files changed, 21 insertions, 4 deletions
diff --git a/examples/box-dynamic/README b/examples/box-dynamic/README
index 561e4841a..bb87b5db7 100644
--- a/examples/box-dynamic/README
+++ b/examples/box-dynamic/README
@@ -1,20 +1,31 @@
- -*- text -*-
+ -*- outline -*-
+
+* Overview
This directory includes an example program for extending Guile with a
new (and even useful) data type, putting it into a shared library, so it
can be called from an unmodified guile interpreter.
+
+* Build Instructions
+
To build the example, simply type
make libbox
in this directory.
+
+* The Box Data Type
+
A box is simply an object for storing one other object in. It can be
used for passing parameters by reference, for example. You simply
store an object into a box, pass it to another procedure which can
store a new object into it and thus return a value via the box.
+
+** Usage
+
Box objects are created with `make-box', set with `box-set!' and
examined with `box-ref'. Note that these procedures are placed in a
module called (box-module) and can thus only be accessed after using
@@ -23,9 +34,8 @@ this module. See the following example session for usage details:
Extend your LD_LIBRARY_PATH variable (or equivalent) to include . and
.libs
-If you like this example so much that you want to have it available
-for normal usage, install the dynamic libraries in the .libs directory
-to the directory $(prefix)/lib
+
+** Example Session
$ ./guile
guile> (load-extension "libbox" "scm_init_box")
@@ -39,3 +49,10 @@ guile> (box-ref b)
(list of values)
guile> (quit)
$
+
+
+* Module Installation
+
+If you like this example so much that you want to have it available
+for normal usage, install the dynamic libraries in the .libs directory
+to the directory $(prefix)/lib