Closed dpk closed 1 month ago
I am investigating this issue. The root cause of the problem seems to be the behaviour of the tests in this program:
(import (chezscheme))
(define qif (quote-syntax if))
(assert (symbol? (syntax->datum qif)))
(assert (identifier? qif))
The first test succeeds, the second test fails.
Okay, this was an easy-to-find mistake. The issue is fixed with the following patch:
diff --git a/s/syntax.ss b/s/syntax.ss
index 197d1b10..9e845119 100644
--- a/s/syntax.ss
+++ b/s/syntax.ss
@@ -6027,10 +6027,11 @@
(_ (syntax-error (source-wrap e w ae))))))
(global-extend 'core 'quote-syntax
- (lambda (e r w ae)
+ (lambda (e r w ae)
+ (let ([e (source-wrap e w ae)])
(syntax-case e ()
- ((_ e) (build-data no-source (source-wrap (syntax e) w ae)))
- (_ (syntax-error (source-wrap e w ae))))))
+ ((_ e) (build-data no-source (syntax e)))
+ (_ (syntax-error e))))))
(global-extend 'core 'syntax
(let ()
I am going to submit a formal pull request.
This has been completed in https://github.com/cisco/ChezScheme/commit/613e127ba4ad5f6a0d03043c6f6688b5bf0d6145 and can be closed.
Changing
quote-syntax
tosyntax
in the definition ofmy-if
fixes it. Commenting outyes-or-no
and usingmy-if
at the REPL fails. But pasting the definition ofmy-if
into the REPL and invoking it directly from the REPL works.