unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] Move let/ec to top-level
@ 2013-01-14 15:20 Nala Ginrut
  2013-01-22 11:43 ` Andy Wingo
  2013-03-27 21:14 ` Ludovic Courtès
  0 siblings, 2 replies; 11+ messages in thread
From: Nala Ginrut @ 2013-01-14 15:20 UTC (permalink / raw)
  To: guile-devel


[-- Attachment #1.1: Type: text/plain, Size: 106 bytes --]

I believe this delayed for a 6+ months. And I'm glad to see it's
implemented with delimited-continuation.

[-- Attachment #1.2: Type: text/html, Size: 135 bytes --]

[-- Attachment #2: 0001-Move-let-ec-to-top-level.patch --]
[-- Type: application/octet-stream, Size: 1656 bytes --]

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-04-06 13:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-14 15:20 [PATCH] Move let/ec to top-level Nala Ginrut
2013-01-22 11:43 ` Andy Wingo
2013-03-27 21:14 ` Ludovic Courtès
2013-04-04  6:19   ` Nala Ginrut
2013-04-05 20:59     ` Ludovic Courtès
2013-04-06  0:52     ` Ian Price
2013-04-06  2:53       ` Nala Ginrut
2013-04-06  1:04     ` Ian Price
2013-04-06 13:38       ` Ludovic Courtès
2013-04-06  2:15     ` Ian Price
2013-04-06 13:41       ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).