From b2c3988d815c3ad1c18bdfa47b61db369661e185 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Thu, 7 Jun 2018 12:21:41 -0700 Subject: [PATCH] =?UTF-8?q?rename=20`test-reader`=20=E2=86=92=20`apply-rea?= =?UTF-8?q?der`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beautiful-racket-lib/br/reader-utils.rkt | 5 ++++- beautiful-racket-lib/br/scribblings/br.scrbl | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/beautiful-racket-lib/br/reader-utils.rkt b/beautiful-racket-lib/br/reader-utils.rkt index 7b7f3f0..124bc4f 100644 --- a/beautiful-racket-lib/br/reader-utils.rkt +++ b/beautiful-racket-lib/br/reader-utils.rkt @@ -2,9 +2,12 @@ (require (for-syntax racket/base racket/syntax br/syntax) br/define syntax/strip-context) (provide (all-defined-out)) -(define (test-reader read-syntax-proc str) +(define (apply-reader read-syntax-proc str) (syntax->datum (read-syntax-proc #f (open-input-string str)))) +;; bw compat +(define test-reader apply-reader) + ;; `define-read-functions` simplifies support for the standard reading API, ;; which asks for `read` and `read-syntax`. ;; in general, `read` is just the datum from the result of `read-syntax`. diff --git a/beautiful-racket-lib/br/scribblings/br.scrbl b/beautiful-racket-lib/br/scribblings/br.scrbl index 870202f..df7980a 100644 --- a/beautiful-racket-lib/br/scribblings/br.scrbl +++ b/beautiful-racket-lib/br/scribblings/br.scrbl @@ -679,11 +679,11 @@ xs @defproc[ -(test-reader +(apply-reader [read-syntax-proc procedure?] [source-str string?]) datum?]{ -Applies @racket[read-syntax-proc] to @racket[source-str] as if it were being read in from a source file. +Applies @racket[read-syntax-proc] to @racket[source-str] as if it were being read in from a source file. Perhaps helpful for testing & debugging. }