From 67ae47bc511f36a3cec362dd9ad499a32d2b9c69 Mon Sep 17 00:00:00 2001
From: Nala Ginrut <NalaGinrut@gmail.com>
Date: Mon, 14 Jan 2013 22:38:01 +0800
Subject: [PATCH] Move let/ec to top-level.

---
 module/ice-9/boot-9.scm  |    9 +++++++++
 module/ice-9/futures.scm |   10 ----------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index e426374..85b380d 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -419,6 +419,15 @@ If there is no handler at all, Guile prints an error and then exits."
 (define-syntax-rule (unless test stmt stmt* ...)
   (if (not test) (begin stmt stmt* ...)))
 
+(define-syntax-rule (let/ec k e e* ...)
+  (let ((tag (make-prompt-tag)))
+    (call-with-prompt
+     tag
+     (lambda ()
+       (let ((k (lambda args (apply abort-to-prompt tag args))))
+         e e* ...))
+     (lambda (_ res) res))))
+
 (define-syntax cond
   (lambda (whole-expr)
     (define (fold f seed xs)
diff --git a/module/ice-9/futures.scm b/module/ice-9/futures.scm
index 6ff104d..069a4f5 100644
--- a/module/ice-9/futures.scm
+++ b/module/ice-9/futures.scm
@@ -99,16 +99,6 @@ touched."
       (lambda () (begin e0 e1 ...))
       (lambda () (unlock-mutex x)))))
 
-(define-syntax-rule (let/ec k e e* ...)           ; TODO: move to core
-  (let ((tag (make-prompt-tag)))
-    (call-with-prompt
-     tag
-     (lambda ()
-       (let ((k (lambda args (apply abort-to-prompt tag args))))
-         e e* ...))
-     (lambda (_ res) res))))
-
-
 (define %future-prompt
   ;; The prompt futures abort to when they want to wait for another
   ;; future.
-- 
1.7.0.4

