"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 or download 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).
    3 
    4 		TOPICS:
    5 
    6 	INTRODUCTION AND GENERAL INFORMATION
    7 	SLIB INSTALLATION PROBLEMS
    8 	USING SLIB PROCEDURES
    9 	MACROS
   10 	SRFI
   11 
   12 		INTRODUCTION AND GENERAL INFORMATION
   13 
   14 []	What is SLIB?
   15 
   16 SLIB is a portable scheme library meant to provide compatibiliy and
   17 utility functions for all standard scheme implementations.
   18 
   19 []	What is Scheme?
   20 
   21 The Algorithmic Language Scheme is a programming language in the Lisp
   22 family.
   23 
   24 []	Which implementations has SLIB been ported to?
   25 
   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.
   30 
   31 []	How can I obtain SLIB?
   32 
   33 SLIB is available via http from:
   34  http://people.csail.mit.edu/jaffer/SLIB.html
   35 SLIB is available via ftp from:
   36  swiss.csail.mit.edu:/pub/scm/
   37 
   38 []	How do I install SLIB?
   39 
   40 Read the INSTALLATION INSTRUCTIONS in "slib/README".
   41 
   42 []	What are slib.texi and slib.info?
   43 
   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.
   48 
   49 Programs for printing and viewing TexInfo documentation (which SLIB
   50 has) come with GNU Emacs or can be obtained via ftp from:
   51  ftp.gnu.org:/pub/gnu/texinfo/texinfo-3.12.tar.gz
   52 
   53 []	How often is SLIB released?
   54 
   55 Several times a year.
   56 
   57 []	What is the latest version?
   58 
   59 The newest released version as of this writing is slib-3b6.  The
   60 documentation for the latest release is available online at:
   61 http://people.csail.mit.edu/jaffer/SLIB.html
   62 
   63 []	Which version am I using?
   64 
   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
   67 (slib:report-version)
   68 
   69 		SLIB INSTALLATION PROBLEMS
   70 
   71 []	When I load an SLIB initialization file for my Scheme
   72 	implementation, I get ERROR: Couldn't find "require.scm"
   73 
   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.
   78 
   79 []	When I load an SLIB initialization file for my Scheme
   80 	implementation, I get ERROR: Couldn't find
   81 	"/usr/local/lib/slibrequire.scm"
   82 
   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.
   87 
   88 []	SLIB used to work, but now I get ERROR: Couldn't find
   89 	"slib/require.scm".  What happened?
   90 
   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.
   95 
   96 []	When I type (require 'macro) I get "ERROR: unbound variable:
   97 	require".
   98 
   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").
  104 
  105 []	Why do I get a string-ref (or other) error when I try to load
  106 	or use SLIB.
  107 
  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.
  113 
  114 		USING SLIB PROCEDURES
  115 
  116 []	I installed SLIB.  When I type (random 5) I get "ERROR:
  117 	unbound variable:  random".  Doesn't SLIB have a `random'
  118 	function?
  119 
  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).
  124 
  125 []	Why doesn't SLIB just load all the functions so I don't have
  126 	to type require statements?
  127 
  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.
  134 
  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))
  138 
  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.
  142 
  143 []	Why does SLIB have PRINTF when it already has the more
  144 	powerful (CommonLisp) FORMAT?
  145 
  146 CommonLisp FORMAT does not support essential features which PRINTF
  147 does.  For instance, how do you format a signed 0 extended number?
  148 
  149   (format t "~8,'0,X~%" -3)	==>	000000-3
  150 
  151 But printf gets it right:
  152 
  153   (printf "%08x\n" -3)		==>	-0000003
  154 
  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:
  160 
  161   (printf "%.20s\n" "the quick brown fox jumped over the lazy dog")
  162 				==>	the quick brown fox
  163 
  164 []	Why doesn't SLIB:ERROR call FORMAT?
  165 
  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.
  169 
  170 		MACROS
  171 
  172 []	Why are there so many macro implementations in SLIB?
  173 
  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.
  180 
  181 []	Why are there both R4RS macros and Common-Lisp style defmacros
  182 	in SLIB?
  183 
  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.
  187 
  188 []	I did (LOAD "slib/yasos.scm").  The error I get is "variable
  189 	define-syntax is undefined".
  190 
  191 The way to load the struct macro package is (REQUIRE 'YASOS).
  192 
  193 []	I did (REQUIRE 'YASOS).  Now when I type (DEFINE-PREDICATE
  194 	CELL?)  The error I get is "variable define-predicate is
  195 	undefined".
  196 
  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)
  202 
  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)
  207 
  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?
  211 
  212 As explained in the Repl entry in slib.info (or slib.texi):
  213 
  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)
  219 
  220 		SRFI
  221 
  222 []	What is SRFI?
  223 
  224 "Scheme Requests for Implementation" is a process and informal
  225 standard for defining extensions to Scheme.
  226 
  227 []	Which SRFIs does SLIB support?
  228 
  229 These can be REQUIREd by the listed (srfi) feature name:
  230 
  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
  247 
  248 srfi-96 "SLIB Prerequisites" is the interface which Scheme
  249 implementations provide in order to host SLIB.