Skip to content

Commit 30c9919

Browse files
committed
support more atomic rewriting
1 parent bd9d670 commit 30c9919

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

redex-doc/redex/scribblings/ref/typesetting.scrbl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,18 +1048,18 @@ The @racket[proc] must match the contract @racket[(-> lw? lw?)].
10481048
Its result should be the rewritten version version of the input.
10491049
}
10501050
1051-
@defform[(with-atomic-rewriter name-symbol
1051+
@defform[(with-atomic-rewriter atom
10521052
string-or-thunk-returning-pict
10531053
expression)]{
10541054
10551055
Extends the current set of atomic-rewriters with one
1056-
new one that rewrites the value of name-symbol to
1056+
new one that rewrites the value of atom to
10571057
@racket[string-or-pict-returning-thunk] (applied, in the case of a
10581058
thunk), during the evaluation of expression.
10591059
1060-
@racket[name-symbol] is expected to evaluate to a symbol. The value
1061-
of @racket[string-or-thunk-returning-pict] is used whenever the symbol
1062-
appears in a pattern.
1060+
@racket[atom] is expected to evaluate to a symbol, boolean, number,
1061+
or string. The value of @racket[string-or-thunk-returning-pict] is
1062+
used that atom appears in a pattern.
10631063
10641064
@ex[
10651065
(define-language lam-lang

redex-pict-lib/redex/private/core-layout.rkt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
(syntax-parse stx
9696
[(_ ([name transformer] ...) e:expr)
9797
#:declare name
98-
(expr/c #'symbol?
98+
(expr/c #'(or/c symbol? boolean? number? string?)
9999
#:name "atomic-rewriter name")
100100
#:declare transformer
101101
(expr/c #'(or/c (-> pict?) string?)
@@ -818,7 +818,7 @@
818818
[(assoc e (atomic-rewrite-table))
819819
=>
820820
(λ (m)
821-
(when (eq? (cadr m) e)
821+
(when (equal? (cadr m) e)
822822
(error 'apply-rewrites "rewritten version of ~s is still ~s" e e))
823823
(let ([p (cadr m)])
824824
(if (procedure? p)

0 commit comments

Comments
 (0)