diff --git a/collects/racket/place.rkt b/collects/racket/place.rkt index ff450f8bf4..a8bd6f8604 100644 --- a/collects/racket/place.rkt +++ b/collects/racket/place.rkt @@ -147,8 +147,7 @@ (syntax-case stx () [(_ ch body1 body ...) (begin - ;breaks valid uses of place - #;(unless (eq? 'module (syntax-local-context)) + #;(when (in-module-expansion?) (raise-syntax-error #f "can only be used in a module" stx)) (unless (identifier? #'ch) (raise-syntax-error #f "expected an indentifier" stx #'ch)) @@ -165,6 +164,7 @@ (resolved-module-path-name (variable-reference->resolved-module-path vr))) - (dynamic-place (if (symbol? name) `',name name) - func-name)) + (when (symbol? name) + (error 'place "the current module-path-name should be a path and not a symbol (if you are in DrRacket, save the file)")) + (dynamic-place name func-name)) diff --git a/collects/tests/racket/place.rktl b/collects/tests/racket/place.rktl index 87fbfbbdd3..4a15ac4427 100644 --- a/collects/tests/racket/place.rktl +++ b/collects/tests/racket/place.rktl @@ -5,6 +5,8 @@ (place-wait (place/base (p1 ch) (printf "Hello from place\n"))) +(err/rt-test (dynamic-place 'tmodule 'tfunc)) + (let ([p (place/base (p1 ch) (printf "Hello form place 2\n") (exit 99))]) diff --git a/src/racket/src/place.c b/src/racket/src/place.c index 97586d357d..ab403b0439 100644 --- a/src/racket/src/place.c +++ b/src/racket/src/place.c @@ -227,6 +227,9 @@ Scheme_Object *scheme_place(int argc, Scheme_Object *args[]) { if (!scheme_is_module_path(args[0]) && !SCHEME_PATHP(args[0])) { scheme_wrong_type("dynamic-place", "module-path or path", 0, argc, args); } + if (SCHEME_SYMBOLP(args[0])) { + scheme_wrong_type("dynamic-place", "non-symbol module-path", 0, argc, args); + } if (!SCHEME_SYMBOLP(args[1])) { scheme_wrong_type("dynamic-place", "symbol", 1, argc, args); }