2022-07-15 21:36:02 +00:00
|
|
|
;;; Copyright 2022 Andrew Whatson
|
|
|
|
|
|
|
|
(define-module (language prescheme spec)
|
2022-07-16 16:13:08 +00:00
|
|
|
#:use-module (system base language)
|
|
|
|
#:use-module (language scheme compile-tree-il)
|
|
|
|
#:use-module (language scheme decompile-tree-il))
|
2022-07-15 21:36:02 +00:00
|
|
|
|
|
|
|
(define (reader port env)
|
|
|
|
(read-syntax port))
|
|
|
|
|
|
|
|
(define (default-environment)
|
|
|
|
(let ((m (make-module)))
|
2022-07-19 10:20:21 +00:00
|
|
|
(module-use! m (resolve-interface '(language prescheme core)))
|
2022-07-15 21:36:02 +00:00
|
|
|
m))
|
|
|
|
|
|
|
|
(define-language prescheme
|
|
|
|
#:title "Pre-Scheme"
|
|
|
|
#:reader reader
|
|
|
|
#:printer write
|
2022-07-16 16:13:08 +00:00
|
|
|
#:compilers `((tree-il . ,compile-tree-il))
|
|
|
|
#:decompilers `((tree-il . ,decompile-tree-il))
|
|
|
|
#:evaluator (lambda (x module) (primitive-eval x))
|
2022-07-15 21:36:02 +00:00
|
|
|
#:make-default-environment default-environment)
|