-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Boot should now be OK. Functions are now defined (and not copied) in the SCHEME module. That means that the functions used by a closure are searched in the SCHEME module. This should fix the first problem exposed in @jpellegrini Issue #367.
- Loading branch information
Erick Gallesio
committed
May 13, 2022
1 parent
7f7e7f5
commit 8bed10c
Showing
3 changed files
with
6,249 additions
and
6,275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
;;;; | ||
;;;; Author: Erick Gallesio [[email protected]] | ||
;;;; Creation date: 01-Jan-2000 15:04 (eg) | ||
;;;; Last file update: 12-May-2022 18:24 (eg) | ||
;;;; Last file update: 13-May-2022 14:49 (eg) | ||
;;;; | ||
|
||
(define original-input-port (current-input-port)) | ||
|
@@ -30,13 +30,9 @@ | |
;; Following code is in the STklos module and is needed to ensure STklos | ||
:; bootstap | ||
;; | ||
|
||
(include "runtime.stk") ; Definitions necessary for the bootstrap | ||
(include "runtime-macros.stk") ; Macros necessary for the bootstrap | ||
(include "module.stk") ; All the macros for defining modules | ||
(include "compiler.stk") ; VM Compiler | ||
(import STKLOS-COMPILER) ; mainly for "eval" | ||
|
||
|
||
;; ---------------------------------------------------------------------- | ||
;; SCHEME Module | ||
|
@@ -55,6 +51,9 @@ | |
(%module-exports-set! (find-module 'SCHEME) | ||
(module-exports (find-module 'STklos))) | ||
|
||
;; NOTE: This include MUST be done early (and not earlier). See why. | ||
(include "compiler.stk") ; VM Compiler (this include MUST be done early) | ||
|
||
|
||
(define-module SCHEME | ||
(include "r5rs.stk") ; R5RS stuff written in Scheme | ||
|
@@ -93,11 +92,11 @@ | |
;; | ||
(import STKLOS-OBJECT MBE SRFI-0 REPL REPL-READLINE) | ||
|
||
|
||
;; | ||
;; Add all the exported bindings in SCHEME module to STklos. Don't use import | ||
;; here, since import makes new bindings read-only (and we want that bindings | ||
;; in STklos can be broken if needed). | ||
;; | ||
(let ((STklos (find-module 'STklos)) | ||
(SCHEME (find-module 'SCHEME))) | ||
(for-each (lambda(x) | ||
|
@@ -111,34 +110,30 @@ | |
(include "./scheme/base.stk") | ||
(include "./scheme/write.stk") | ||
|
||
|
||
;; | ||
;; It's time to lock the SCHEME module, that is make bindings in it read-only | ||
;; and forbid further definitions. | ||
(define-module SCHEME | ||
(import STKLOS-OBJECT MBE SRFI-0 REPL REPL-READLINE) ; as in STklos | ||
(import STKLOS-COMPILER STKLOS-OBJECT MBE SRFI-0 REPL REPL-READLINE) | ||
|
||
;; During he bootstap, the module SCHEME is present and all the definitions | ||
;; made above (yes above!!), need an unlocked SCHEME module. So, the module | ||
;; SCHEME is closed only for user programs (in this case STKLOS_BUILDING is | ||
;; not defined) | ||
(unless (getenv "STKLOS_BUILDING") | ||
;; We are not bootstapping | ||
(module-lock! (find-module 'SCHEME)))) | ||
|
||
(module-lock! (current-module)))) | ||
|
||
|
||
;; ====================================================================== | ||
;; | ||
;; Define exception handlers, analyze options and eventually launch REPL | ||
;; Define exception handlers, analyze options | ||
;; | ||
;; Execute the REPL only if a file was not given on the command line | ||
;; ====================================================================== | ||
|
||
;; Execute the REPL only if a file was not given on the command line | ||
(define %before-exit-hook void) | ||
|
||
;; A main function which will probably overloaded by the user | ||
(define main void) | ||
(define main void) ;; A main function which will probably overloaded by the user | ||
|
||
;; ---------------------------------------------------------------------- | ||
;; %display-backtrace ... | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.