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