initial.scm 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ; Copyright (c) 1993-2005 by Richard Kelsey and Jonathan Rees. See file COPYING.
  2. ; Link script.
  3. (define (link-initial-system)
  4. (let ((structures-to-open ;Structures to open for the initial
  5. (struct-list scheme ;system's read-eval-print loop.
  6. environments
  7. module-system
  8. ensures-loaded
  9. packages
  10. packages-internal))) ; package-for-syntax
  11. (link-reified-system (append (desirable-structures)
  12. structures-to-open)
  13. '(build initial)
  14. ;; The expression that evaluates to the
  15. ;; procedure that maps the reified-structure alist
  16. ;; to the startup procedure:
  17. `(start ',(map car structures-to-open))
  18. ;; Structures to open for evaluating that
  19. ;; expression and the expression that
  20. ;; evaluates to the reified-structure alist:
  21. initial-system
  22. for-reification
  23. ;; scheme-level-1
  24. )))
  25. (define (desirable-structures)
  26. (let ((env (interaction-environment))
  27. (l '()))
  28. (for-each (lambda (int)
  29. (for-each-declaration
  30. (lambda (name package-name type)
  31. (if (not (assq name l))
  32. (let ((s (eval name env)))
  33. (if (structure? s)
  34. (set! l (cons (cons name s) l))))))
  35. int))
  36. (list low-structures-interface
  37. run-time-structures-interface
  38. features-structures-interface
  39. run-time-internals-structures-interface
  40. compiler-structures-interface
  41. initial-structures-interface))
  42. (reverse l)))
  43. ; Your choice of evaluators:
  44. (define scheme (make-scheme environments evaluation))
  45. ; (define scheme (make-scheme mini-environments mini-eval))
  46. ; (define scheme (make-scheme environments run))
  47. ; etc.
  48. ; Your choice of command processors.
  49. (define initial-system
  50. (make-initial-system scheme (make-mini-command scheme)))