Commit | Line | Data |
---|---|---|
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 |
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: | |
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,,, |
27 | slib, 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 |
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 | |
dc061a74 | 40 | is 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 |
50 | The following procedure works, e.g., with SLIB version 3a3 |
51 | (@pxref{Installation, SLIB installation,, slib, The SLIB Portable Scheme | |
52 | Library}): | |
a0e07ba4 NJ |
53 | |
54 | @enumerate | |
55 | @item | |
dc061a74 LC |
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/}. | |
ecb87335 | 58 | Running @code{make install-info} installs its documentation, by default |
dc061a74 | 59 | under @file{/usr/local/info/}. |
a0e07ba4 NJ |
60 | |
61 | @item | |
dc061a74 | 62 | Define 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 | ||
69 | Alternatively, you can create a symlink in the Guile directory to SLIB, | |
70 | e.g.: | |
71 | ||
72 | @example | |
22b5f518 | 73 | ln -s /usr/local/lib/slib /usr/local/share/guile/@value{EFFECTIVE-VERSION}/slib |
a0e07ba4 NJ |
74 | @end example |
75 | ||
76 | @item | |
85a9b4ed | 77 | Use Guile to create the catalog file, e.g.,: |
a0e07ba4 NJ |
78 | |
79 | @example | |
80 | # guile | |
81 | guile> (use-modules (ice-9 slib)) | |
dc061a74 | 82 | guile> (require 'new-catalog) |
a0e07ba4 NJ |
83 | guile> (quit) |
84 | @end example | |
85 | ||
85a9b4ed | 86 | The catalog data should now be in |
22b5f518 | 87 | @file{/usr/local/share/guile/@value{EFFECTIVE-VERSION}/slibcat}. |
a0e07ba4 NJ |
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, | |
a60cb893 | 96 | or to modify @file{ice-9/slib.scm} to use @code{define-public} for the |
a0e07ba4 NJ |
97 | offending 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 |
108 | Jacal is a symbolic math package written in Scheme by Aubrey Jaffer. |
109 | It is usually installed as an extra package in SLIB. | |
a0e07ba4 NJ |
110 | |
111 | You 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 | |
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, | |
a60cb893 | 122 | JACAL 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: |