From 351977f0c2e5fefe30fddd7ca020ab4c2d2713a1 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 14 Jun 2017 21:30:48 +0200 Subject: [PATCH 2/2] Restrict define-foreign-type forms to the toplevel This brings this in line with how the other define forms work. Signed-off-by: Peter Bex --- core.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core.scm b/core.scm index 2dccf48..c24ee15 100644 --- a/core.scm +++ b/core.scm @@ -1204,6 +1204,11 @@ (let ((name (second x)) (type (strip-syntax (third x))) (conv (cdddr x))) + (unless tl? + (quit-compiling + "~adefinition of foreign type `~s' in non-toplevel context" + (if ln (sprintf "(~a) - " ln) "") + name)) (cond [(pair? conv) (let ([arg (gensym)] [ret (gensym)] ) -- 2.1.4