slib.texi 2.9 KB

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