lucid-script.lisp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ; Part of Scheme 48 1.9. See file COPYING for notices and license.
  2. ; Authors: Richard Kelsey, Jonathan Rees
  3. ; Script to load the Scheme 48 linker into Common Lisp.
  4. ; Requires Pseudoscheme 2.11.
  5. (defvar pseudoscheme-directory "../pseudo/")
  6. (load (concatenate 'string pseudoscheme-directory "loadit.lisp"))
  7. ; or perhaps (load (merge-pathnames "loadit.lisp" pseudoscheme-directory))
  8. (load-pseudoscheme pseudoscheme-directory)
  9. (progn (revised^4-scheme::define-sharp-macro #\.
  10. #'(lambda (c port)
  11. (read-char port)
  12. (eval (let ((*readtable* ps::scheme-readtable))
  13. (read port)))))
  14. (values))
  15. (ps:scheme)
  16. ;--------------------
  17. ; Scheme forms
  18. (benchmark-mode)
  19. (define config-env ; (interaction-environment) would also work here.
  20. (#.'scheme-translator:make-program-env
  21. '%config
  22. (list #.'scheme-translator:revised^4-scheme-structure)))
  23. (load "bcomp/module-language" config-env)
  24. (load "alt/config" config-env)
  25. (load "env/flatload" config-env)
  26. (eval '(set! *load-file-type* #f) config-env)
  27. (define load-config
  28. (let ((load-config (eval 'load-configuration config-env)))
  29. (lambda (filename)
  30. (load-config filename config-env))))
  31. (load-config "packages")
  32. (define flatload-package (eval 'flatload config-env))
  33. (flatload-package (eval 'linker-structures config-env) config-env)
  34. (let ((#.'clever-load:*compile-if-necessary-p* #t))
  35. (let ((#.'ps:*scheme-read* #.'#'ps::scheme-read-using-commonlisp-reader))
  36. (load "alt/pseudoscheme-record")
  37. (load "alt/pseudoscheme-features")))
  38. (let ((#.'clever-load:*compile-if-necessary-p* #t))
  39. (flatload-package (eval 'link-config config-env)))
  40. (load "alt/init-defpackage.scm")
  41. (define-syntax struct-list ;not in link.sbin
  42. (syntax-rules ()
  43. ((struct-list ?name ...) (list (cons '?name ?name) ...))))
  44. ;--------------------
  45. (quit)
  46. #+Lucid
  47. (defun disksave-restart-function ()
  48. (format t "~&Scheme 48 linker.~2%")
  49. ;; (hax:init-interrupt-delivery) - for threads
  50. (ps:scheme)
  51. (terpri))
  52. #+Lucid
  53. (defun dump-linker ()
  54. (lcl:disksave "link/linker-in-lucid" :gc t :full-gc t :verbose t
  55. :restart-function #'disksave-restart-function))
  56. ;(dump-linker)
  57. ;(lcl:quit)
  58. ; Debugging hacks
  59. ;(defun enable-lisp-packages ()
  60. ; (setq *readtable* ps:scheme-readtable)
  61. ; (values))
  62. ;(defun disable-lisp-packages ()
  63. ; (setq *readtable* ps::roadblock-readtable)
  64. ; (values))