Error messages for using places with symbol module paths
This commit is contained in:
parent
6e2487bffa
commit
261f002ce2
|
@ -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))
|
||||
|
||||
|
|
|
@ -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))])
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user