"Fossies" - the Fresh Open Source Software Archive
Member "slib-3b6/FAQ" (16 Feb 2020, 8806 Bytes) of package /linux/privat/slib-3b6.tar.gz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard
) with prefixed line numbers.
Alternatively you can here view
the uninterpreted source code file.
See also the latest Fossies "Diffs"
side-by-side code changes report for "FAQ": 3b5_vs_3b6
1 FAQ (Frequently Asked Questions and answers) for SLIB Scheme Library (slib-3b6).
2 Written by Aubrey Jaffer (http://people.csail.mit.edu/jaffer).
6 INTRODUCTION AND GENERAL INFORMATION
7 SLIB INSTALLATION PROBLEMS
8 USING SLIB PROCEDURES
12 INTRODUCTION AND GENERAL INFORMATION
14  What is SLIB?
16 SLIB is a portable scheme library meant to provide compatibiliy and
17 utility functions for all standard scheme implementations.
19  What is Scheme?
21 The Algorithmic Language Scheme is a programming language in the Lisp
24  Which implementations has SLIB been ported to?
26 SLIB supports Bigloo, Chez, ELK 3.0, Gambit 4.0, Guile, JScheme,
27 MacScheme, MITScheme, PLT Scheme (DrScheme and MzScheme), Pocket
28 Scheme, RScheme, S7, scheme->C, Scheme48, SCM, SCM Mac, scsh, SISC,
29 Stk, T3.1, umb-scheme, and VSCM.
31  How can I obtain SLIB?
33 SLIB is available via http from:
35 SLIB is available via ftp from:
38  How do I install SLIB?
40 Read the INSTALLATION INSTRUCTIONS in "slib/README".
42  What are slib.texi and slib.info?
44 "slib.texi" is the `texinfo' format documentation for SLIB.
45 "slib.info" is produced from "slib.texi" by either Gnu Emacs or the
46 program `makeinfo'. "slib.info" can be viewed using either Gnu Emacs
47 or `info' or a text editor.
49 Programs for printing and viewing TexInfo documentation (which SLIB
50 has) come with GNU Emacs or can be obtained via ftp from:
53  How often is SLIB released?
55 Several times a year.
57  What is the latest version?
59 The newest released version as of this writing is slib-3b6. The
60 documentation for the latest release is available online at:
63  Which version am I using?
65 The Version is in the first line of the files slib/FAQ, slib/ANNOUNCE,
66 and slib/README. If you have Scheme and SLIB running, type
69 SLIB INSTALLATION PROBLEMS
71  When I load an SLIB initialization file for my Scheme
72 implementation, I get ERROR: Couldn't find "require.scm"
74 Did you remember to set either the environment variable
75 SCHEME_LIBRARY_PATH or the library-vicinity in your initialization
76 file to the correct location? If you set SCHEME_LIBRARY_PATH, make
77 sure that the Scheme implementation supports getenv.
79  When I load an SLIB initialization file for my Scheme
80 implementation, I get ERROR: Couldn't find
83 Notice that it is looking for "slibrequire.scm" rather than
84 "slib/require.scm". You need to put a trailing slash on either the
85 environment variable SCHEME_LIBRARY_PATH or in the library-vicinity in
86 your initialization file.
88  SLIB used to work, but now I get ERROR: Couldn't find
89 "slib/require.scm". What happened?
91 You changed directories and now the relative pathname
92 "slib/require.scm" no longer refers to the same directory. The
93 environment variable SCHEME_LIBRARY_PATH and library-vicinity in your
94 initialization file should be absolute pathnames.
96  When I type (require 'macro) I get "ERROR: unbound variable:
99 You need to arrange to have your Scheme implementation load the
100 appropriate SLIB initialization file ("foo.init") before using SLIB.
101 If your implementation loads an initialization file on startup, you
102 can have it load the SLIB initialization file automatically. For
103 example (load "/usr/local/lib/slib/foo.init").
105  Why do I get a string-ref (or other) error when I try to load
106 or use SLIB.
108 Check that the version of the Scheme implementation you are using
109 matches the version for which the SLIB initialization file was
110 written. There are some notes in the SLIB initialization files about
111 earlier versions. You may need to get a more recent version of your
112 Scheme implementation.
114 USING SLIB PROCEDURES
116  I installed SLIB. When I type (random 5) I get "ERROR:
117 unbound variable: random". Doesn't SLIB have a `random'
120 Before you can use most SLIB functions, the associated module needs to
121 be loaded. You do this by typing the line that appears at the top of
122 the page in slib.info (or slib.texi) where the function is documented.
123 In the case of random, that line is (require 'random).
125  Why doesn't SLIB just load all the functions so I don't have
126 to type require statements?
128 SLIB has more than 1 Megabyte of Scheme source code. Many scheme
129 implementations take unacceptably long to load 1 Megabyte of source;
130 some implementations cannot allocate enough storage. If you use a
131 package often, you can put the require statement in your Scheme
132 initialization file. Consult the manual for your Scheme
133 implementation to find out the initialization file's name.
135 `Autoloads' will work with many Scheme implementations. You could put
136 the following in your initialization file:
137 (define (random . args) (require 'random) (apply random args))
139 I find that I only type require statements at top level when
140 debugging. I put require statements in my Scheme files so that the
141 appropriate modules are loaded automatically.
143  Why does SLIB have PRINTF when it already has the more
144 powerful (CommonLisp) FORMAT?
146 CommonLisp FORMAT does not support essential features which PRINTF
147 does. For instance, how do you format a signed 0 extended number?
149 (format t "~8,'0,X~%" -3) ==> 000000-3
151 But printf gets it right:
153 (printf "%08x\n" -3) ==> -0000003
155 How can one trunctate a non-numeric field using FORMAT? This feature
156 is essential for printing reports. The first 20 letters of a name is
157 sufficient to identify it. But if that name doesn't get trucated to
158 the desired length it can displace other fields off the page. Once
159 again, printf gets it right:
161 (printf "%.20s\n" "the quick brown fox jumped over the lazy dog")
162 ==> the quick brown fox
164  Why doesn't SLIB:ERROR call FORMAT?
166 Format does not provide a method to truncate fields. When an error
167 message contains non-terminating or large expressions, the essential
168 information of the message may be lost in the ensuing deluge.
172  Why are there so many macro implementations in SLIB?
174 The R4RS committee specified only the high level pattern language in
175 the Revised^4 Report on Scheme and left to the free marketplace of
176 ideas the details of the low-level facility. Each macro package has a
177 different low-level facility. The low-level facilities are sometimes
178 needed because the high level pattern language is insufficiently
179 powerful to accomplish tasks macros are often written to do.
181  Why are there both R4RS macros and Common-Lisp style defmacros
182 in SLIB?
184 Most Scheme implementations predate the adoption of the R4RS macro
185 specification. All of the implementations except scheme48 version
186 0.45 support defmacro natively.
188  I did (LOAD "slib/yasos.scm"). The error I get is "variable
189 define-syntax is undefined".
191 The way to load the struct macro package is (REQUIRE 'YASOS).
193  I did (REQUIRE 'YASOS). Now when I type (DEFINE-PREDICATE
194 CELL?) The error I get is "variable define-predicate is
197 If your Scheme does not natively support R4RS macros, you will need to
198 install a macro-capable read-eval-print loop. This is done by:
199 (require 'macro) ;already done if you did (require 'yasos)
200 (require 'repl)
201 (repl:top-level macro:eval)
203 This would also be true for a Scheme implementation which didn't
204 support DEFMACRO. The lines in this case would be:
205 (require 'repl)
206 (repl:top-level defmacro:eval)
208  I always use R4RS macros with an implementation which doesn't
209 natively support them. How can I avoid having to type require
210 statements every time I start Scheme?
212 As explained in the Repl entry in slib.info (or slib.texi):
214 To have your top level loop always use macros, add any interrupt
215 catching code and the following script to your Scheme init file:
216 (require 'macro)
217 (require 'repl)
218 (repl:top-level macro:eval)
222  What is SRFI?
224 "Scheme Requests for Implementation" is a process and informal
225 standard for defining extensions to Scheme.
227  Which SRFIs does SLIB support?
229 These can be REQUIREd by the listed (srfi) feature name:
231 srfi-0: Feature-based conditional expansion construct
232 srfi-1: List Library
233 srfi-2: AND-LET*: an AND with local bindings, a guarded LET* special form
234 srfi-8: receive: Binding to multiple values
235 srfi-9: Defining Record Types
236 srfi-11: Syntax for receiving multiple values
237 srfi-23: Error reporting mechanism
238 srfi-28: Basic Format Strings
239 srfi-39: Parameter objects
240 srfi-47: Array
241 srfi-59: Vicinity
242 srfi-60: Integers as Bits
243 srfi-61: A more general cond clause
244 srfi-63: Homogeneous and Heterogeneous Arrays
245 srfi-94: Type-Restricted Numerical Functions
246 srfi-95: Sorting and Merging
248 srfi-96 "SLIB Prerequisites" is the interface which Scheme
249 implementations provide in order to host SLIB.