From 498be2fe033e6699c5f53901cd7ca0aadf9015d8 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Wed, 20 May 2020 20:14:38 +0200 Subject: [PATCH 2/2] Remove several obsolete leftovers from earlier refactors Some of these were due to various macro and module overhauls which have now been completed. After removal, core can still be bootstrapped with CHICKEN 5.2.0, so it's completely safe to finally remove this cruft. Could not yet remove ##sys#register-record-printer! because it was still being used by some macros. These have now been updated to use chicken.base#set-record-printer! so this can be finally removed after we make a new development snapshot. --- chicken-syntax.scm | 22 +++++----------------- chicken.time.import.scm | 5 +---- expand.scm | 1 - profiler.scm | 3 +-- 4 files changed, 7 insertions(+), 24 deletions(-) diff --git a/chicken-syntax.scm b/chicken-syntax.scm index e3c2feb4..c1ade0ab 100644 --- a/chicken-syntax.scm +++ b/chicken-syntax.scm @@ -1044,8 +1044,9 @@ (##sys#er-transformer (lambda (form r c) (##sys#check-syntax 'define-record-printer form '(_ _ . _)) - (let ([head (cadr form)] - [body (cddr form)]) + (let ((head (cadr form)) + (body (cddr form)) + (%set-record-printer! (r 'chicken.base#set-record-printer!))) (cond [(pair? head) (##sys#check-syntax 'define-record-printer (cons head body) @@ -1056,7 +1057,7 @@ (##sys#module-name (##sys#current-module)) '|#| plain-name) plain-name))) - `(##sys#register-record-printer + `(,%set-record-printer! (##core#quote ,tag) (##core#lambda ,(##sys#slot head 1) ,@body)))] (else @@ -1067,7 +1068,7 @@ (##sys#module-name (##sys#current-module)) '|#| plain-name) plain-name))) - `(##sys#register-record-printer + `(,%set-record-printer! (##core#quote ,tag) ,@body)))))))) ;;; SRFI-9: @@ -1308,19 +1309,6 @@ (macro-subset me0 ##sys#default-macro-environment))) - -(set! ##sys#chicken-macro-environment ;; OBSOLETE, remove after bootstrapping - (let ((me0 (##sys#macro-environment))) - -;; capture current macro env and add all the preceding ones as well - -;; TODO: omit `chicken.{base,condition,time,type}-m-e' when plain "chicken" module goes away -(append ##sys#chicken.condition-macro-environment - ##sys#chicken.time-macro-environment - ##sys#chicken.type-macro-environment - ##sys#chicken.base-macro-environment - (macro-subset me0 ##sys#default-macro-environment)))) - ;; register features (chicken.platform#register-feature! 'srfi-8 'srfi-11 'srfi-15 'srfi-16 'srfi-26 'srfi-31) diff --git a/chicken.time.import.scm b/chicken.time.import.scm index eb4a4b29..464bce39 100644 --- a/chicken.time.import.scm +++ b/chicken.time.import.scm @@ -30,7 +30,4 @@ (current-milliseconds . chicken.time#current-milliseconds) ; DEPRECATED (current-process-milliseconds . chicken.time#current-process-milliseconds) (current-seconds . chicken.time#current-seconds)) - ;; OBSOLETE: This can be removed after bootstrapping - (if (##sys#symbol-has-toplevel-binding? '##sys#chicken.time-macro-environment) - ##sys#chicken.time-macro-environment - ##sys#chicken.base-macro-environment)) + ##sys#chicken.time-macro-environment) diff --git a/expand.scm b/expand.scm index 3e60f7e7..b228be8c 100644 --- a/expand.scm +++ b/expand.scm @@ -163,7 +163,6 @@ (define ##sys#scheme-macro-environment '()) ; reassigned below ;; These are all re-assigned by chicken-syntax.scm: -(define ##sys#chicken-macro-environment '()) ; used later in chicken.import.scm [OBSOLETE] (define ##sys#chicken-ffi-macro-environment '()) ; used later in foreign.import.scm (define ##sys#chicken.condition-macro-environment '()) ; used later in chicken.condition.import.scm (define ##sys#chicken.time-macro-environment '()) ; used later in chicken.time.import.scm diff --git a/profiler.scm b/profiler.scm index cbd3f78d..eafb0646 100644 --- a/profiler.scm +++ b/profiler.scm @@ -81,8 +81,7 @@ ;;; Entry and exit into/out of profiled lambda: -;; XXX TODO: Should be changed to unsigned-integer64 after bootstrapping -(define cpu-ms (foreign-lambda unsigned-integer "C_cpu_milliseconds")) +(define cpu-ms (foreign-lambda unsigned-integer64 "C_cpu_milliseconds")) (define ##sys#profile-entry (let ((maxfix most-positive-fixnum)) -- 2.20.1