On Wed, Mar 14, 2018 at 06:55:08PM +1300, Evan Hanson wrote:
> Hi hackers,
> 
> As the commit message for the second patch says: now that all built-in
> values are namespaced rather than marked as "##core#primitive" and
> aliased with a "#%" prefix, we can drop all special handling for
> primitive variable marks.

Excellent!  I'm very happy we got rid of that hack.  Attached is another
patch to complete your work, because the ##core#aliased marking is also
no longer required now that everything is fully modularised.

This also brings me closer to my personal goal of getting rid of the
abomination known as ##sys#alias-global-hook ;)

Cheers,
Peter
From f17769b11a9bb22773bf9278644a03399eef9abf Mon Sep 17 00:00:00 2001
From: Peter Bex <pe...@more-magic.net>
Date: Sun, 18 Mar 2018 15:01:00 +0100
Subject: [PATCH] Remove ##core#aliased marking

This is no longer needed, as all lookups are done either through the
syntax environment or via fully qualified symbols; there are no more
unqualified global symbols around.

This also brings us closer towards fixing #1131
---
 modules.scm | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/modules.scm b/modules.scm
index 1a88dc92..df1fe24a 100644
--- a/modules.scm
+++ b/modules.scm
@@ -34,8 +34,8 @@
   (fixnum)
   (not inline ##sys#alias-global-hook)
   (hide check-for-redef find-export find-module/import-library
-	mark-imported-symbols match-functor-argument merge-se
-	module-indirect-exports module-rename register-undefined))
+	match-functor-argument merge-se module-indirect-exports
+	module-rename register-undefined))
 
 (import scheme
 	chicken.base
@@ -251,14 +251,6 @@
     (set! ##sys#module-table (cons (cons name mod) ##sys#module-table))
     mod) )
 
-(define (mark-imported-symbols se)
-  (for-each
-   (lambda (imp)
-     (when (and (symbol? (cdr imp)) (not (eq? (car imp) (cdr imp))))
-       (dm `(MARKING: ,(cdr imp)))
-       (putp (cdr imp) '##core#aliased #t)))
-   se))
-
 (define (module-indirect-exports mod)
   (let ((exports (module-export-list mod))
 	(mname (module-name mod))
@@ -382,7 +374,6 @@
 		(##sys#macro-environment)
 		(##sys#current-environment)
 		iexps vexports sexps nexps)))
-    (mark-imported-symbols iexps)
     (for-each
      (lambda (sexp)
        (set-car! (cdr sexp) (merge-se (or (cadr sexp) '()) senv)))
@@ -533,7 +524,6 @@
 			(##sys#macro-environment) 
 			(##sys#current-environment) 
 			iexports vexports sexports sdlist)))
-	  (mark-imported-symbols iexports)
 	  (for-each
 	   (lambda (m)
 	     (let ((se (merge-se (cadr m) new-se))) ;XXX needed?
@@ -720,7 +710,6 @@
     (dd `(IMPORT: ,loc))
     (dd `(V: ,(if cm (module-name cm) '<toplevel>) ,(map-se vsv)))
     (dd `(S: ,(if cm (module-name cm) '<toplevel>) ,(map-se vss)))
-    (mark-imported-symbols vsv) ; mark imports as ##core#aliased
     (for-each
      (lambda (imp)
        (and-let* ((id (car imp))
@@ -778,9 +767,6 @@
 	     (module-rename sym (module-name mod))))
 	  (else sym)))
   (cond ((##sys#qualified-symbol? sym) sym)
-	((getp sym '##core#aliased)
-	 (dm "(ALIAS) marked: " sym)
-	 sym)
 	((namespaced-symbol? sym) sym)
 	((assq sym ((##sys#active-eval-environment))) =>
 	 (lambda (a)
-- 
2.11.0

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to