From a8ca75b773b109192bbcda355a98ef5c335ee74a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 25 Apr 2012 19:54:00 -0600 Subject: [PATCH] fix documentation example for `protect-out' The example relied on the current code inspector affecting syntax object created during `eval', but since the switch from certificates to taints, the relevant code inspector is determined by the namespace, and a namespace gets its code inspector at creation time. Closes PR 12717 --- collects/scribblings/reference/syntax.scrbl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/collects/scribblings/reference/syntax.scrbl b/collects/scribblings/reference/syntax.scrbl index 7c33159f27..d7725addc7 100644 --- a/collects/scribblings/reference/syntax.scrbl +++ b/collects/scribblings/reference/syntax.scrbl @@ -982,7 +982,13 @@ as follows. (define weak-inspector (make-inspector (current-code-inspector))) (define (weak-eval x) (parameterize ([current-code-inspector weak-inspector]) - (eval x))) + (define weak-ns (make-base-namespace)) + (namespace-attach-module (current-namespace) + ''nest + weak-ns) + (parameterize ([current-namespace weak-ns]) + (namespace-require ''nest) + (eval x)))) (require 'nest) (list num-eggs num-chicks) (weak-eval 'num-eggs)