Advertisement
Guest User

Untitled

a guest
Aug 8th, 2019
155
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defpackage "YOUR-SCHEME-IMPLEMENTATION"
  2. (:use "COMMON-LISP")
  3. (:documentation "Implements a scheme in Common-Lisp")
  4. (:export "DEFINE" "RUN"))
  5.  
  6. (defpackage "YOUR-SCHEME-USER"
  7. (:use "YOUR-SCHEME-IMPLEMENTATION")
  8. (:documentation "The run-time your-scheme user package."))
  9.  
  10. (in-package "YOUR-SCHEME-IMPLEMENTATION") ; <--
  11.  
  12. (defun run ()
  13. (let ((*package* (or (find-package "YOUR-SCHEME-USER") ; <--
  14. (error "Cannot find runtime scheme user package."))))
  15. (loop
  16. :named REPL
  17. :for form := (read)
  18. :for result := (scheme-eval form)
  19. :do (print result))))
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement