1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004
@c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
@page
@node SLIB
@section SLIB
@cindex SLIB
Before the SLIB facilities can be used, the following Scheme expression
must be executed:
@smalllisp
(use-modules (ice-9 slib))
@end smalllisp
@findex require
@code{require} can then be used in the usual way (@pxref{Require,,,
slib, The SLIB Manual}). For example,
@example
(use-modules (ice-9 slib))
(require 'primes)
(probably-prime? 13)
@result{} #t
@end example
Note that the following Guile core functions are overridden by
@code{(ice-9 slib)}, to implement SLIB specified semantics.
@table @code
@item delete-file
@findex delete-file
Returns @code{#t} for success or @code{#f} for failure
(@pxref{Input/Output,,, slib, The SLIB Manual}), as opposed to the
Guile core version unspecified for success and throwing an error for
failure (@pxref{File System}).
@c `provide' is also exported by ice-9 slib, but its definition in
@c slib require.scm is the same as guile boot-9.scm, so believe
@c nothing needs to be said about that.
@item provided?
@findex provided?
Accepts a feature specification containing @code{and} and @code{or}
forms combining symbols (@pxref{Feature,,, slib, The SLIB Manual}), as
opposed to the Guile core taking only plain symbols (@pxref{Feature
Manipulation}).
@item open-file
@findex open-file
Takes a symbol @code{r}, @code{rb}, @code{w} or @code{wb} for the open
mode (@pxref{Input/Output,,, slib, The SLIB Manual}), as opposed to
the Guile core version taking a string (@pxref{File Ports}).
@item system
@findex system
Returns a plain exit code 0 to 255 (@pxref{System Interface,,, slib,
The SLIB Manual}), as opposed to the Guile core version returning a
wait status that must be examined with @code{status:exit-val} etc
(@pxref{Processes}).
@end table
@menu
* SLIB installation::
* JACAL::
@end menu
@node SLIB installation
@subsection SLIB installation
The following seems to work (e.g., with slib versions 2c7 and 2d2):
@enumerate
@item
Unpack slib somewhere, e.g., @file{/usr/local/share/slib}.
@item
Create a symlink in the Guile site directory to slib, e.g.,:
@example
ln -s /usr/local/share/slib /usr/local/share/guile/site/slib
@end example
@item
Use Guile to create the catalog file, e.g.,:
@example
# guile
guile> (use-modules (ice-9 slib))
guile> (load "/usr/local/share/slib/mklibcat.scm")
guile> (quit)
@end example
The catalog data should now be in
@file{/usr/local/share/guile/site/slibcat}.
If instead you get an error such as:
@example
Unbound variable: scheme-implementation-type
@end example
then a solution is to get a newer version of Guile,
or to modify @file{ice-9/slib.scm} to use @code{define-public} for the
offending variables.
@item
Install the documentation:
@example
cd /usr/local/share/slib
rm /usr/local/info/slib.info*
cp slib.info /usr/local/info
install-info slib.info /usr/local/info/dir
@end example
@end enumerate
@node JACAL
@subsection JACAL
@cindex JACAL
@cindex Jaffer, Aubrey
@cindex symbolic math
@cindex math -- symbolic
Jacal is a symbolic math package written in Scheme by Aubrey Jaffer.
It is usually installed as an extra package in SLIB.
You can use Guile's interface to SLIB to invoke Jacal:
@smalllisp
(use-modules (ice-9 slib))
(slib:load "math")
(math)
@end smalllisp
@noindent
For complete documentation on Jacal, please read the Jacal manual. If
it has been installed on line, you can look at @ref{Top, , Jacal, jacal,
JACAL Symbolic Mathematics System}. Otherwise you can find it on the web at
@url{http://www-swiss.ai.mit.edu/~jaffer/JACAL.html}
@c Local Variables:
@c TeX-master: "guile.texi"
@c End:
|