From 2c5522dfff3c9a837f057b2d178a3bf81fbc9205 Mon Sep 17 00:00:00 2001
From: Alex Shinn <ashinn@users.noreply.github.com>
Date: Mon, 1 Oct 2012 22:56:21 +0900
Subject: [PATCH] Don't unwrap syntatic closures in top-level defines by
 default.

---
 eval.c                   | 2 ++
 include/chibi/features.h | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/eval.c b/eval.c
index 1efa4fff..e4895137 100644
--- a/eval.c
+++ b/eval.c
@@ -784,7 +784,9 @@ static sexp analyze_define (sexp ctx, sexp x) {
       sexp_push(ctx, sexp_lambda_defs(sexp_env_lambda(env)), tmp);
       res = SEXP_VOID;
     } else {
+#if SEXP_USE_UNWRAPPED_TOPLEVEL_BINDINGS
       if (sexp_synclop(name)) name = sexp_synclo_expr(name);
+#endif
       sexp_env_cell_define(ctx, env, name, SEXP_VOID, &varenv);
       if (sexp_pairp(sexp_cadr(x))) {
         tmp = sexp_cons(ctx, sexp_cdadr(x), sexp_cddr(x));
diff --git a/include/chibi/features.h b/include/chibi/features.h
index abaaabf2..f7394bda 100644
--- a/include/chibi/features.h
+++ b/include/chibi/features.h
@@ -404,6 +404,10 @@
 #endif
 #endif
 
+#if SEXP_USE_UNWRAPPED_TOPLEVEL_BINDINGS
+#define SEXP_USE_UNWRAPPED_TOPLEVEL_BINDINGS 0
+#endif
+
 #ifndef SEXP_USE_EXTENDED_FCALL
 #define SEXP_USE_EXTENDED_FCALL (!SEXP_USE_NO_FEATURES)
 #endif