From fe1e9ed7f5eda19837fb8f0955aa2807cc82b95b Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sat, 10 Apr 2021 15:20:04 +0200 Subject: [PATCH] Minor cleanup Symbols and keywords are disjoint now, so we can remove the needless checks that say (and (symbol? x) (not (keyword? x))), because if something's a symbol, it cannot be a keyword too. This gets rid of some compilation warnings for expand.scm. --- expand.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/expand.scm b/expand.scm index 8da8b2c0..9a3ee7ac 100644 --- a/expand.scm +++ b/expand.scm @@ -763,10 +763,10 @@ (or (##sys#extended-lambda-list? x) (let loop ((x x)) (cond ((null? x)) - ((symbol? x) (not (keyword? x))) + ((symbol? x)) ((pair? x) (let ((s (car x))) - (and (symbol? s) (not (keyword? s)) + (and (symbol? s) (loop (cdr x)) ) ) ) (else #f) ) ) ) ) @@ -849,7 +849,7 @@ (inherit-pair-line-numbers sym (cons (rename (car sym)) (rename (cdr sym))))) ((vector? sym) (list->vector (rename (vector->list sym)))) - ((or (not (symbol? sym)) (keyword? sym)) sym) + ((not (symbol? sym)) sym) ((assq sym renv) => (lambda (a) (dd `(RENAME/RENV: ,sym --> ,(cdr a))) @@ -872,8 +872,8 @@ (do ((i 0 (fx+ i 1)) (f #t (compare (vector-ref s1 i) (vector-ref s2 i)))) ((or (fx>= i len) (not f)) f)))))) - ((and (symbol? s1) (not (keyword? s1)) - (symbol? s2) (not (keyword? s2))) + ((and (symbol? s1) + (symbol? s2)) (let ((ss1 (or (getp s1 '##core#macro-alias) (lookup2 1 s1 dse) s1) ) @@ -912,7 +912,7 @@ sym (cons (mirror-rename (car sym)) (mirror-rename (cdr sym))))) ((vector? sym) (list->vector (mirror-rename (vector->list sym)))) - ((or (not (symbol? sym)) (keyword? sym)) sym) + ((not (symbol? sym)) sym) (else ; Code stolen from strip-syntax (let ((renamed (lookup sym se) ) ) (cond ((assq-reverse sym renv) => -- 2.20.1