Use proper types for hash/assoc functions in `hashtab.h'.
[bpt/guile.git] / doc / ref / slib.texi
1 @c -*-texinfo-*-
2 @c This is part of the GNU Guile Reference Manual.
3 @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007
4 @c Free Software Foundation, Inc.
5 @c See the file guile.texi for copying conditions.
6
7 @node SLIB
8 @section SLIB
9 @cindex SLIB
10
11 Before the SLIB facilities can be used, the following Scheme expression
12 must be executed:
13
14 @lisp
15 (use-modules (ice-9 slib))
16 @end lisp
17
18 @findex require
19 @code{require} can then be used in the usual way (@pxref{Require,,,
20 slib, The SLIB Manual}). For example,
21
22 @example
23 (use-modules (ice-9 slib))
24 (require 'primes)
25 (prime? 13)
26 @result{} #t
27 @end example
28
29 A few Guile core functions are overridden by the SLIB setups; for
30 example the SLIB version of @code{delete-file} returns a boolean
31 indicating success or failure, whereas the Guile core version throws
32 an error for failure. In general (and as might be expected) when SLIB
33 is loaded it's the SLIB specifications that are followed.
34
35 @menu
36 * SLIB installation::
37 * JACAL::
38 @end menu
39
40 @node SLIB installation
41 @subsection SLIB installation
42
43 The following procedure works, e.g., with SLIB version 3a3
44 (@pxref{Installation, SLIB installation,, slib, The SLIB Portable Scheme
45 Library}):
46
47 @enumerate
48 @item
49 Unpack SLIB and install it using @code{make install} from its directory.
50 By default, this will install SLIB in @file{/usr/local/lib/slib/}.
51 Running @code{make installinfo} installs its documentation, by default
52 under @file{/usr/local/info/}.
53
54 @item
55 Define the @code{SCHEME_LIBRARY_PATH} environment variable:
56
57 @example
58 $ SCHEME_LIBRARY_PATH=/usr/local/lib/slib/
59 $ export SCHEME_LIBRARY_PATH
60 @end example
61
62 Alternatively, you can create a symlink in the Guile directory to SLIB,
63 e.g.:
64
65 @example
66 ln -s /usr/local/lib/slib /usr/local/share/guile/@value{EFFECTIVE-VERSION}/slib
67 @end example
68
69 @item
70 Use Guile to create the catalog file, e.g.,:
71
72 @example
73 # guile
74 guile> (use-modules (ice-9 slib))
75 guile> (require 'new-catalog)
76 guile> (quit)
77 @end example
78
79 The catalog data should now be in
80 @file{/usr/local/share/guile/@value{EFFECTIVE-VERSION}/slibcat}.
81
82 If instead you get an error such as:
83
84 @example
85 Unbound variable: scheme-implementation-type
86 @end example
87
88 then a solution is to get a newer version of Guile,
89 or to modify @file{ice-9/slib.scm} to use @code{define-public} for the
90 offending variables.
91
92 @end enumerate
93
94 @node JACAL
95 @subsection JACAL
96 @cindex JACAL
97
98 @cindex Jaffer, Aubrey
99 @cindex symbolic math
100 @cindex math -- symbolic
101 Jacal is a symbolic math package written in Scheme by Aubrey Jaffer.
102 It is usually installed as an extra package in SLIB.
103
104 You can use Guile's interface to SLIB to invoke Jacal:
105
106 @lisp
107 (use-modules (ice-9 slib))
108 (slib:load "math")
109 (math)
110 @end lisp
111
112 @noindent
113 For complete documentation on Jacal, please read the Jacal manual. If
114 it has been installed on line, you can look at @ref{Top, , Jacal, jacal,
115 JACAL Symbolic Mathematics System}. Otherwise you can find it on the web at
116 @url{http://www-swiss.ai.mit.edu/~jaffer/JACAL.html}
117
118
119 @c Local Variables:
120 @c TeX-master: "guile.texi"
121 @c End: