home *** CD-ROM | disk | FTP | other *** search
/ Dream 44 / Amiga_Dream_44.iso / RiscPc / programmation / scm4e2.arc / !Scm / slibdocs / FAQ < prev    next >
Text File  |  1994-07-12  |  7KB  |  184 lines

  1. FAQ (Frequently Asked Questions and answers) for SLIB Scheme Library (slib2a2).
  2. Written by Aubrey Jaffer (jaffer@ai.mit.edu).
  3.  
  4.         INTRODUCTION AND GENERAL INFORMATION
  5.  
  6. []    What is SLIB?
  7.  
  8. SLIB is a portable scheme library meant to provide compatibiliy and
  9. utility functions for all standard scheme implementations.
  10.  
  11. []    What is Scheme?
  12.  
  13. Scheme is a programming language in the Lisp family.
  14.  
  15. []    Which implementations has SLIB been ported to?
  16.  
  17. SLIB is currently supported by Chez, ELK 2.1, GAMBIT, MacScheme,
  18. MITScheme, scheme->C, Scheme48, T3.1, SCM and VSCM
  19.  
  20. []    How can I get SLIB?
  21.  
  22. SLIB is available via ftp from:
  23.  altdorf.ai.mit.edu:archive/scm/slib2a2.tar.gz
  24.  prep.ai.mit.edu:pub/gnu/jacal/slib2a2.tar.gz
  25.  ftp.maths.tcd.ie:pub/bosullvn/jacal/slib2a2.tar.gz
  26.  ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib2a2.tar.gz
  27.  
  28. SLIB is also included with SCM floppy disks.
  29.  
  30. []    How do I install SLIB?
  31.  
  32. Read the INSTALLATION INSTRUCTIONS in "slib/README".
  33.  
  34. []    What are slib.texi and slib.info?
  35.  
  36. "slib.texi" is the `texinfo' format documentation for SLIB.
  37. "slib.info" is produced from "slib.texi" by either Gnu Emacs or the
  38. program `makeinfo'.  "slib.info" can be viewed using either Gnu Emacs
  39. or `info' or a text editor.
  40.  
  41. Programs for printing and viewing TexInfo documentation (which SLIB
  42. has) come with GNU Emacs or can be obtained via ftp from:
  43. prep.ai.mit.edu:pub/gnu/texinfo-3.1.tar.gz
  44.  
  45. []    How often is SLIB released?
  46.  
  47. SLIB was released 9 times in 1993.
  48.  
  49. []    What is the latest version?
  50.  
  51. The version as of this writing is slib2a2.
  52.  
  53. []    What version am I using?
  54.  
  55. The Version is in the first line of the files slib/FAQ, slib/ANNOUNCE,
  56. and slib/README.  If you have Scheme and SLIB running, type
  57. (slib:report-version)
  58.  
  59.         SLIB INSTALLATION PROBLEMS
  60.  
  61. []    When I load an SLIB initialization file for my Scheme
  62.     implementation, I get ERROR: Couldn't find "require.scm"
  63.  
  64. Did you remember to set either the environment variable
  65. SCHEME_LIBRARY_PATH or the library-vicinity in your initialization
  66. file to the correct location?  Make sure if you set only the
  67. environment variable SCHEME_LIBRARY_PATH that your implementation
  68. supports getenv.
  69.  
  70. []    When I load an SLIB initialization file for my Scheme
  71.     implementation, I get ERROR: Couldn't find
  72.     "/usr/local/lib/slibrequire.scm"
  73.  
  74. Notice that it is looking for "slibrequire.scm" rather than
  75. "slib/require.scm".  You need to put a trailing slash on either the
  76. environment variable SCHEME_LIBRARY_PATH or in the library-vicinity in
  77. your initialization file.
  78.  
  79. []    SLIB used to work, but now I get ERROR: Couldn't find
  80.     "slib/require.scm".  What happened?
  81.  
  82. You changed directories and now the relative pathname
  83. "slib/require.scm" no longer refers to the same directory.  The
  84. environment variable SCHEME_LIBRARY_PATH and library-vicinity in your
  85. initialization file need to refer to absolute pathnames.
  86.  
  87. []    When I type (require 'macro) I get "ERROR: unbound variable:
  88.     require".
  89.  
  90. You need to arrange to have your Scheme implementation load the
  91. appropriate SLIB initialization file ("foo.init") before using SLIB.
  92. If your implementation loads an initialization file on startup, you
  93. can have it load the SLIB initialization file automatically.  For
  94. example (load "/usr/local/lib/slib/foo.init").
  95.  
  96. []    Why do I get a string-ref (or other) error when I try to load
  97.     or use SLIB.
  98.  
  99. Check that the version of the Scheme implementation you are using
  100. matches the version for which the SLIB initialization file was
  101. written.  There are some notes in the SLIB initialization files about
  102. earlier versions.  You may need to get a more recent version of your
  103. Scheme implementation.
  104.  
  105.         USING SLIB PROCEDURES
  106.  
  107. []    I installed SLIB.  When I type (random 5) I get "ERROR:
  108.     unbound variable:  random".  Doesn't SLIB have a `random'
  109.     function?
  110.  
  111. Before you can use most SLIB functions, the associated module needs to
  112. be loaded.  You do this by typing the line that appears at the top of
  113. the page in slib.info (or slib.texi) where the function is documented.
  114. In the case of random, the line is (require 'random).
  115.  
  116. []    Why doesn't SLIB just load all the functions so I don't have
  117.     to type require statements?
  118.  
  119. SLIB currently has almost 1 Megabyte of Scheme source code.  Many
  120. scheme implementations would take a long time to load all this and
  121. some cannot allocate enough storage.  If you use a package often, you
  122. can put the require statement in your Scheme initialization file.
  123. Consult the manual for your Scheme implementation to find out the
  124. initialization file's name.
  125.  
  126. Also, many Schemes will work with autoloads.  You could put the
  127. following in your init file:
  128.  (define (random . args) (require 'random) (apply random args))
  129.  
  130. I find that I only type require statements at top level when
  131. debugging.  I put require statements in my Scheme files so that the
  132. appropriate modules are loaded automatically.
  133.  
  134.         MACROS
  135.  
  136. []    Why are there so many macro implementations in SLIB?
  137.  
  138. The R4RS committee specified only the high level pattern language in
  139. the Revised^4 Report on Scheme and left to the free marketplace of
  140. ideas the details of the low-level facility.  Each macro package has a
  141. different low-level facility.  The low-level facilities are sometimes
  142. needed because the high level pattern language is insufficiently
  143. powerful to accomplish tasks macros are often written to do.
  144.  
  145. []    Why are there both R4RS macros and Common-Lisp style defmacros
  146.     in SLIB?
  147.  
  148. Most current Scheme implementations predate the adoption of the R4RS
  149. macro specification.  It turns out that most of the implementations
  150. can support defmacro natively (the rest can support defmacro using
  151. defmacex.scm).
  152.  
  153. []    I did (LOAD "slib/yasos.scm").  The error I get is "variable
  154.     define-syntax is undefined".
  155.  
  156. The way to load the struct macro package is (REQUIRE 'YASOS).
  157.  
  158. []    I did (REQUIRE 'YASOS).  Now when I type (DEFINE-PREDICATE
  159.     CELL?)  The error I get is "variable define-predicate is
  160.     undefined".
  161.  
  162. If like most implementations, your Scheme does not natively support
  163. R4RS macros you will need to install a macro-capable read-eval-print
  164. loop.  This is done by:
  165.  (require 'macro)    ;already done if you did (require 'yasos)
  166.  (require 'repl)
  167.  (repl:top-level macro:eval)
  168.  
  169. This is also true for Schemes which don't support DEFMACRO.  The lines
  170. in this case are:
  171.  (require 'repl)
  172.  (repl:top-level defmacro:eval)
  173.  
  174. []    I always use R4RS macros.  How can I avoid having to type
  175.     require statements every time I start Scheme?
  176.  
  177. As is explained in the Repl entry in slib.info (or slib.texi):
  178.  
  179.  To have your top level loop always use macros, add any interrupt
  180.  catching lines and the following lines to your Scheme init file:
  181.   (require 'macro)
  182.   (require 'repl)
  183.   (repl:top-level macro:eval)
  184.