slib.texi 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. @c -*-texinfo-*-
  2. @c This is part of the GNU Guile Reference Manual.
  3. @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007
  4. @c Free Software Foundation, Inc.
  5. @c See the file guile.texi for copying conditions.
  6. @node SLIB
  7. @section SLIB
  8. @cindex SLIB
  9. SLIB is a portable library of Scheme packages which can be used with
  10. Guile and other Scheme implementations. SLIB is not included in the
  11. Guile distribution, but can be installed separately (@pxref{SLIB
  12. installation}). It is available from
  13. @url{http://people.csail.mit.edu/jaffer/SLIB.html}.
  14. After SLIB is installed, the following Scheme expression must be
  15. executed before the SLIB facilities can be used:
  16. @lisp
  17. (use-modules (ice-9 slib))
  18. @end lisp
  19. @findex require
  20. @noindent
  21. @code{require} can then be used in the usual way (@pxref{Require,,,
  22. slib, The SLIB Manual}). For example,
  23. @example
  24. (use-modules (ice-9 slib))
  25. (require 'primes)
  26. (prime? 13)
  27. @result{} #t
  28. @end example
  29. A few Guile core functions are overridden by the SLIB setups; for
  30. example the SLIB version of @code{delete-file} returns a boolean
  31. indicating success or failure, whereas the Guile core version throws
  32. an error for failure. In general (and as might be expected) when SLIB
  33. is loaded it's the SLIB specifications that are followed.
  34. @menu
  35. * SLIB installation::
  36. * JACAL::
  37. @end menu
  38. @node SLIB installation
  39. @subsection SLIB installation
  40. The following procedure works, e.g., with SLIB version 3a3
  41. (@pxref{Installation, SLIB installation,, slib, The SLIB Portable Scheme
  42. Library}):
  43. @enumerate
  44. @item
  45. Unpack SLIB and install it using @code{make install} from its directory.
  46. By default, this will install SLIB in @file{/usr/local/lib/slib/}.
  47. Running @code{make install-info} installs its documentation, by default
  48. under @file{/usr/local/info/}.
  49. @item
  50. Define the @code{SCHEME_LIBRARY_PATH} environment variable:
  51. @example
  52. $ SCHEME_LIBRARY_PATH=/usr/local/lib/slib/
  53. $ export SCHEME_LIBRARY_PATH
  54. @end example
  55. Alternatively, you can create a symlink in the Guile directory to SLIB,
  56. e.g.:
  57. @example
  58. ln -s /usr/local/lib/slib /usr/local/share/guile/@value{EFFECTIVE-VERSION}/slib
  59. @end example
  60. @item
  61. Use Guile to create the catalog file, e.g.,:
  62. @example
  63. # guile
  64. guile> (use-modules (ice-9 slib))
  65. guile> (require 'new-catalog)
  66. guile> (quit)
  67. @end example
  68. The catalog data should now be in
  69. @file{/usr/local/share/guile/@value{EFFECTIVE-VERSION}/slibcat}.
  70. If instead you get an error such as:
  71. @example
  72. Unbound variable: scheme-implementation-type
  73. @end example
  74. then a solution is to get a newer version of Guile,
  75. or to modify @file{ice-9/slib.scm} to use @code{define-public} for the
  76. offending variables.
  77. @end enumerate
  78. @node JACAL
  79. @subsection JACAL
  80. @cindex JACAL
  81. @cindex Jaffer, Aubrey
  82. @cindex symbolic math
  83. @cindex math -- symbolic
  84. Jacal is a symbolic math package written in Scheme by Aubrey Jaffer.
  85. It is usually installed as an extra package in SLIB.
  86. You can use Guile's interface to SLIB to invoke Jacal:
  87. @lisp
  88. (use-modules (ice-9 slib))
  89. (slib:load "math")
  90. (math)
  91. @end lisp
  92. @noindent
  93. For complete documentation on Jacal, please read the Jacal manual. If
  94. it has been installed on line, you can look at @ref{Top, , Jacal, jacal,
  95. JACAL Symbolic Mathematics System}. Otherwise you can find it on the web at
  96. @url{http://www-swiss.ai.mit.edu/~jaffer/JACAL.html}
  97. @c Local Variables:
  98. @c TeX-master: "guile.texi"
  99. @c End: