lucid-script.lisp 2.2 KB

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