load-real.scm 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. #| -*-Scheme-*-
  2. Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
  3. 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
  4. 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Massachusetts
  5. Institute of Technology
  6. This file is part of MIT/GNU Scheme.
  7. MIT/GNU Scheme 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. MIT/GNU Scheme is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with MIT/GNU Scheme; if not, write to the Free Software
  17. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
  18. USA.
  19. |#
  20. ;;;; Scmutils top-level loader
  21. (set! load-debugging-info-on-demand? #t)
  22. (ge user-initial-environment)
  23. (add-subsystem-identification! "ScmUtils" '("Mechanics" "Fall 2013"))
  24. (define scmutils-base-environment user-initial-environment)
  25. (environment-define scmutils-base-environment
  26. '*environment*
  27. 'scmutils-base-environment)
  28. (load "general/comutils" scmutils-base-environment)
  29. (start-canonicalizing-symbols!)
  30. (environment-define scmutils-base-environment
  31. 'derivative-symbol
  32. (string->symbol "D"))
  33. (define (in-scmutils-directory relative-path thunk)
  34. (with-working-directory-pathname
  35. (merge-pathnames (pathname-as-directory relative-path)
  36. (directory-pathname (current-load-pathname)))
  37. thunk))
  38. (load-option 'hash-table)
  39. (load-option 'synchronous-subprocess)
  40. (in-scmutils-directory "./general"
  41. (lambda ()
  42. (load "load" scmutils-base-environment)))
  43. (in-scmutils-directory "./kernel"
  44. (lambda ()
  45. (load "load" scmutils-base-environment)))
  46. ;;; kernel/genenv.scm defines the generic environment
  47. (environment-define system-global-environment 'generic-environment
  48. (access generic-environment scmutils-base-environment))
  49. (environment-define system-global-environment 'user-generic-environment
  50. (extend-top-level-environment
  51. (access generic-environment scmutils-base-environment)))
  52. (environment-define user-generic-environment
  53. '*environment*
  54. 'user-generic-environment)
  55. (in-scmutils-directory "./simplify"
  56. (lambda ()
  57. (load "load" scmutils-base-environment)))
  58. (environment-define system-global-environment
  59. 'symbolic-environment
  60. (access symbolic-environment scmutils-base-environment))
  61. (environment-define system-global-environment
  62. 'rule-environment
  63. (access rule-environment scmutils-base-environment))
  64. (define symbolic-operators
  65. (hash-table/key-list symbolic-operator-table))
  66. (in-scmutils-directory "./display"
  67. (lambda ()
  68. (load "load" scmutils-base-environment)))
  69. (in-scmutils-directory "./enclose"
  70. (lambda ()
  71. (load "load" scmutils-base-environment)))
  72. (in-scmutils-directory "./numerics"
  73. (lambda ()
  74. (load "load" scmutils-base-environment)))
  75. (in-scmutils-directory "./poly"
  76. (lambda ()
  77. (load "load" scmutils-base-environment)))
  78. (start-preserving-case!)
  79. (in-scmutils-directory "./kernel"
  80. (lambda ()
  81. (load "litfun" scmutils-base-environment)))
  82. (in-scmutils-directory "./solve"
  83. (lambda ()
  84. (load "load" scmutils-base-environment)))
  85. (in-scmutils-directory "./units"
  86. (lambda ()
  87. (load "load" scmutils-base-environment)))
  88. (in-scmutils-directory "./mechanics"
  89. (lambda ()
  90. (load "load" scmutils-base-environment)))
  91. (in-scmutils-directory "./calculus"
  92. (lambda ()
  93. (load "load" scmutils-base-environment)))
  94. ;;; Should be a place to put useful stuff like this.
  95. (define (Sigma a b proc)
  96. (g:sigma proc a b))
  97. (in-scmutils-directory "./general"
  98. (lambda ()
  99. (load "let-macro"
  100. user-generic-environment)))
  101. ;;; To fix the problem that students cannot change find-path.
  102. (in-scmutils-directory "./mechanics"
  103. (lambda ()
  104. (load "find-path-patch"
  105. user-generic-environment)))
  106. ;;; To fix bugs, e.g. in X11graphics
  107. (in-scmutils-directory "."
  108. (lambda ()
  109. (load "patch"
  110. user-initial-environment)))
  111. (start-scmutils-print)
  112. (ge user-generic-environment)