[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 04/12: psyntax: Rename top-level-eval, local-eval
From: |
Andy Wingo |
Subject: |
[Guile-commits] 04/12: psyntax: Rename top-level-eval, local-eval |
Date: |
Fri, 15 Nov 2024 10:25:31 -0500 (EST) |
wingo pushed a commit to branch main
in repository guile.
commit dd18780fb847e4e0f5243955226034a83bb0c972
Author: Andy Wingo <wingo@pobox.com>
AuthorDate: Thu Nov 14 16:02:20 2024 +0100
psyntax: Rename top-level-eval, local-eval
* module/ice-9/psyntax.scm (top-level-eval, local-eval): Rename from
top-level-eval-hook, local-eval-hook. Adapt callers.
* module/ice-9/psyntax-pp.scm: Regenerate.
---
module/ice-9/psyntax-pp.scm | 22 +++++++++++-----------
module/ice-9/psyntax.scm | 32 +++++++++++++++-----------------
2 files changed, 26 insertions(+), 28 deletions(-)
diff --git a/module/ice-9/psyntax-pp.scm b/module/ice-9/psyntax-pp.scm
index 48f3cee00..0798331f6 100644
--- a/module/ice-9/psyntax-pp.scm
+++ b/module/ice-9/psyntax-pp.scm
@@ -45,8 +45,8 @@
(lambda? (lambda (x) (and (struct? x) (eq? (struct-vtable x)
(vector-ref %expanded-vtables 14)))))
(lambda-meta (lambda (x) (struct-ref x 1)))
(set-lambda-meta! (lambda (x v) (struct-set! x 1 v)))
- (top-level-eval-hook (lambda (x mod) (primitive-eval x)))
- (local-eval-hook (lambda (x mod) (primitive-eval x)))
+ (top-level-eval (lambda (x mod) (primitive-eval x)))
+ (local-eval (lambda (x mod) (primitive-eval x)))
(session-id
(let ((v (module-variable (current-module) 'syntax-session-id)))
(lambda () ((variable-ref v)))))
(sourcev-filename (lambda (s) (vector-ref s 0)))
@@ -467,13 +467,13 @@
(record-definition! id var)
(list (if (eq? m 'c&e)
(let ((x
(build-global-definition s mod var (expand e r w mod))))
- (top-level-eval-hook x
mod)
+ (top-level-eval x mod)
(lambda () x))
(call-with-values
(lambda ()
(resolve-identifier id '(()) r mod #t))
(lambda (type* value*
mod*)
(if (eq? type* 'macro)
- (top-level-eval-hook
+ (top-level-eval
(build-global-definition s mod var (build-void s))
mod))
(lambda ()
@@ -490,7 +490,7 @@
(cond
((memq 'compile esew)
(let ((e
(expand-install-global mod var type (expand e r w mod))))
- (top-level-eval-hook e mod)
+ (top-level-eval e mod)
(if (memq 'load esew)
(list (lambda () e)) '())))
((memq 'load esew)
(list (lambda ()
@@ -498,10 +498,10 @@
(else '())))
((memv key '(c&e))
(let ((e (expand-install-global
mod var type (expand e r w mod))))
- (top-level-eval-hook e mod)
+ (top-level-eval e mod)
(list (lambda () e))))
(else (if (memq 'eval esew)
- (top-level-eval-hook
+ (top-level-eval
(expand-install-global mod var type (expand e r w mod))
mod))
'())))))
@@ -537,7 +537,7 @@
'(eval))
(begin
(if (memq
'expand when-list)
-
(top-level-eval-hook
+
(top-level-eval
(expand-top-sequence body r w s 'e '(eval) mod)
mod))
'())))
@@ -552,7 +552,7 @@
((or (memq
'compile when-list)
(memq
'expand when-list)
(and (eq? m
'c&e) (memq 'eval when-list)))
-
(top-level-eval-hook
+ (top-level-eval
(expand-top-sequence body r w s 'e '(eval) mod)
mod)
'())
@@ -564,7 +564,7 @@
tmp-1))))
(else (list (if (eq? m 'c&e)
(let ((x (expand-expr
type value form e r w s mod)))
- (top-level-eval-hook
x mod)
+ (top-level-eval x mod)
(lambda () x))
(lambda () (expand-expr
type value form e r w s mod)))))))))))))
(let ((exps (map (lambda (x) (x)) (reverse (parse body r w
s m esew mod)))))
@@ -955,7 +955,7 @@
(syntax-violation #f "bad local syntax definition"
(source-wrap e w s mod))))))
(eval-local-transformer
(lambda (expanded mod)
- (let ((p (local-eval-hook expanded mod)))
+ (let ((p (local-eval expanded mod)))
(if (procedure? p) p (syntax-violation #f "nonprocedure
transformer" p)))))
(expand-void (lambda () (build-void #f)))
(ellipsis?
diff --git a/module/ice-9/psyntax.scm b/module/ice-9/psyntax.scm
index a08b115b4..843a99607 100644
--- a/module/ice-9/psyntax.scm
+++ b/module/ice-9/psyntax.scm
@@ -186,13 +186,11 @@
(define-syntax fx= (identifier-syntax =))
(define-syntax fx< (identifier-syntax <))
- (define top-level-eval-hook
- (lambda (x mod)
- (primitive-eval x)))
+ (define (top-level-eval x mod)
+ (primitive-eval x))
- (define local-eval-hook
- (lambda (x mod)
- (primitive-eval x)))
+ (define (local-eval x mod)
+ (primitive-eval x))
;; Capture syntax-session-id before we shove it off into a module.
(define session-id
@@ -1101,7 +1099,7 @@
(list
(if (eq? m 'c&e)
(let ((x (build-global-definition s mod var (expand
e r w mod))))
- (top-level-eval-hook x mod)
+ (top-level-eval x mod)
(lambda () x))
(call-with-values
(lambda () (resolve-identifier id empty-wrap r
mod #t))
@@ -1109,9 +1107,9 @@
;; If the identifier to be bound is currently
bound to a
;; macro, then immediately discard that binding.
(if (eq? type* 'macro)
- (top-level-eval-hook (build-global-definition
- s mod var (build-void
s))
- mod))
+ (top-level-eval (build-global-definition
+ s mod var (build-void s))
+ mod))
(lambda ()
(build-global-definition s mod var (expand e r
w mod)))))))))
((define-syntax-form define-syntax-parameter-form)
@@ -1125,7 +1123,7 @@
(cond
((memq 'compile esew)
(let ((e (expand-install-global mod var type (expand
e r w mod))))
- (top-level-eval-hook e mod)
+ (top-level-eval e mod)
(if (memq 'load esew)
(list (lambda () e))
'())))
@@ -1135,11 +1133,11 @@
(else '())))
((c&e)
(let ((e (expand-install-global mod var type (expand e
r w mod))))
- (top-level-eval-hook e mod)
+ (top-level-eval e mod)
(list (lambda () e))))
(else
(if (memq 'eval esew)
- (top-level-eval-hook
+ (top-level-eval
(expand-install-global mod var type (expand e r w
mod))
mod))
'()))))
@@ -1165,7 +1163,7 @@
'(eval))
(begin
(if (memq 'expand when-list)
- (top-level-eval-hook
+ (top-level-eval
(expand-top-sequence body r w s 'e
'(eval) mod)
mod))
'())))
@@ -1180,7 +1178,7 @@
((or (memq 'compile when-list)
(memq 'expand when-list)
(and (eq? m 'c&e) (memq 'eval when-list)))
- (top-level-eval-hook
+ (top-level-eval
(expand-top-sequence body r w s 'e '(eval) mod)
mod)
'())
@@ -1190,7 +1188,7 @@
(list
(if (eq? m 'c&e)
(let ((x (expand-expr type value form e r w s mod)))
- (top-level-eval-hook x mod)
+ (top-level-eval x mod)
(lambda () x))
(lambda ()
(expand-expr type value form e r w s mod)))))))))
@@ -1727,7 +1725,7 @@
(define eval-local-transformer
(lambda (expanded mod)
- (let ((p (local-eval-hook expanded mod)))
+ (let ((p (local-eval expanded mod)))
(if (procedure? p)
p
(syntax-violation #f "nonprocedure transformer" p)))))
- [Guile-commits] branch main updated (bb7154fb8 -> 2daea4020), Andy Wingo, 2024/11/15
- [Guile-commits] 05/12: psyntax: Clean up use of fx+, etc, Andy Wingo, 2024/11/15
- [Guile-commits] 06/12: psyntax: Functional annotation of function names, Andy Wingo, 2024/11/15
- [Guile-commits] 10/12: psyntax: Add simple pattern matcher, Andy Wingo, 2024/11/15
- [Guile-commits] 04/12: psyntax: Rename top-level-eval, local-eval,
Andy Wingo <=
- [Guile-commits] 07/12: psyntax: Inline the single use of define-structure, Andy Wingo, 2024/11/15
- [Guile-commits] 08/12: psyntax: Remove a useless level of let, Andy Wingo, 2024/11/15
- [Guile-commits] 12/12: psyntax: Use new `match' instead of cdadring, Andy Wingo, 2024/11/15
- [Guile-commits] 11/12: psyntax: Use new `match' instead of cdadring, Andy Wingo, 2024/11/15
- [Guile-commits] 09/12: psyntax: Avoid lambda in procedure definitions, Andy Wingo, 2024/11/15
- [Guile-commits] 01/12: psyntax: Clean up lexical gensym creation, Andy Wingo, 2024/11/15
- [Guile-commits] 03/12: psyntax: Use vectors instead of gensyms for labels, marks, Andy Wingo, 2024/11/15
- [Guile-commits] 02/12: psyntax: Remove useless gen-label invocations, Andy Wingo, 2024/11/15