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