home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / runtime / optiondb.scm < prev    next >
Text File  |  2000-06-08  |  4KB  |  85 lines

  1. #| -*-Scheme-*-
  2.  
  3. $Id: optiondb.scm,v 1.9 2000/06/08 16:31:45 cph Exp $
  4.  
  5. Copyright (c) 1994-2000 Massachusetts Institute of Technology
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful, but
  13. WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. |#
  21.  
  22. (declare (usual-integrations))
  23.  
  24. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  25. ;;
  26. ;; This file contains Scheme code to define a set of load options.  Each
  27. ;; time a new (not-yet-loaded) load option is requested, this file is
  28. ;; loaded into a fresh environment which has the system global
  29. ;; environment as parent.
  30. ;;
  31. ;; Procedures used for defining load options:
  32. ;;
  33. ;; (DEFINE-LOAD-OPTION 'NAME loader loader ...)
  34. ;;   Defines a load option (NAME) which is loaded by the execution of its
  35. ;;   loaders.  Loaders are executed left to right.  Loaders are thunks.
  36. ;;
  37. ;; (STANDARD-OPTION-LOADER 'PACKAGE-NAME 'EXPR file file ...)
  38. ;;   Creates a loader that loads the files (strings relative to
  39. ;;   $MITSCHEME_LIBRARY_PATH/options) into the environment of the
  40. ;;   package named PACKAGE-NAME, and then evaluates EXPR in that load
  41. ;;   environment. If EXPR is #F of course evaluating it has no effect.
  42. ;; 
  43. ;; (FURTHER-LOAD-OPTIONS EXPR)
  44. ;;   EXPR is the place to look next for the load options.  Useful objects
  45. ;;   are STANDARD-LOAD-OPTIONS (load options supplied with the
  46. ;;   MIT-Scheme distribution) and LOCAL-LOAD-OPTIONS (load options
  47. ;;   supplied for every user of your architecture at your site).  If
  48. ;;   not specified, or is #F, then this file is the last options
  49. ;;   database that is searched.
  50.  
  51. ;; Standard load options are defined like this:
  52.  
  53. (define-load-option 'ARITHMETIC-INTERFACE
  54.   (standard-option-loader '(RUNTIME NUMBER INTERFACE) #F "numint"))
  55.  
  56. ;; We can use programming to make the definitions less noisy and tedious:
  57.  
  58. (for-each
  59.  (lambda (spec)
  60.    (define-load-option (car spec) (apply standard-option-loader (cdr spec))))
  61.  '((COMPRESS    (RUNTIME COMPRESS)    #F            "cpress")
  62.    (DOSPROCESS    ()            #F            "dosproc")
  63.    (FORMAT    (RUNTIME FORMAT)    (INITIALIZE-PACKAGE!)    "format")
  64.    (GDBM    (RUNTIME GDBM)        (INITIALIZE-PACKAGE!)    "gdbm")
  65.    (HASH-TABLE    (RUNTIME HASH-TABLE)    (INITIALIZE-PACKAGE!)    "hashtb")
  66.    (KRYPT    (RUNTIME KRYPT)        #F            "krypt")
  67.    (MIME-CODEC    (RUNTIME MIME-CODEC)    #F            "mime-codec")
  68.    (ORDERED-VECTOR (RUNTIME ORDERED-VECTOR) #F            "ordvec")
  69.    (RB-TREE    (RUNTIME RB-TREE)    #F            "rbtree")
  70.    (STEPPER    (RUNTIME STEPPER)    #F            "ystep")
  71.    (SUBPROCESS    (RUNTIME SUBPROCESS)    (INITIALIZE-PACKAGE!)    "process")
  72.    (SYNCHRONOUS-SUBPROCESS (RUNTIME SYNCHRONOUS-SUBPROCESS) #F    "syncproc")
  73.    (WT-TREE    (RUNTIME WT-TREE)    #F            "wttree")
  74.    ))
  75.  
  76. (define-load-option 'REGULAR-EXPRESSION
  77.   (standard-option-loader '(RUNTIME REGULAR-EXPRESSION-COMPILER)
  78.               #F
  79.               "rgxcmp")
  80.   (standard-option-loader '(RUNTIME CHAR-SYNTAX)
  81.               '(INITIALIZE-PACKAGE!)
  82.               "chrsyn")
  83.   (standard-option-loader '(RUNTIME REGULAR-EXPRESSION)
  84.               '(INITIALIZE-PACKAGE!)
  85.               "regexp"))