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