From 087e65ef1c22084ae529bbaaebc1c46a8817bd54 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Fri, 26 Jun 2015 13:18:22 +0900 Subject: [PATCH] don't define (picrin control escape) in callcc.c --- Makefile | 1 + contrib/10.callcc/callcc.c | 4 ---- piclib/picrin/control.scm | 6 ++++++ 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 piclib/picrin/control.scm diff --git a/Makefile b/Makefile index ccc08d82..9758d93a 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ PICRIN_LIBS = \ piclib/picrin/macro.scm\ piclib/picrin/record.scm\ piclib/picrin/array.scm\ + piclib/picrin/control.scm\ piclib/picrin/experimental/lambda.scm\ piclib/picrin/syntax-rules.scm\ piclib/picrin/test.scm diff --git a/contrib/10.callcc/callcc.c b/contrib/10.callcc/callcc.c index 2e2561fe..d4bed2e8 100644 --- a/contrib/10.callcc/callcc.c +++ b/contrib/10.callcc/callcc.c @@ -297,10 +297,6 @@ pic_callcc_callcc(pic_state *pic) void pic_init_callcc(pic_state *pic) { - pic_deflibrary (pic, "(picrin control)") { - pic_define(pic, "escape", pic_ref(pic, pic->PICRIN_BASE, "call-with-current-continuation")); - } - pic_deflibrary (pic, "(scheme base)") { pic_redefun(pic, pic->PICRIN_BASE, "call-with-current-continuation", pic_callcc_callcc); pic_redefun(pic, pic->PICRIN_BASE, "call/cc", pic_callcc_callcc); diff --git a/piclib/picrin/control.scm b/piclib/picrin/control.scm new file mode 100644 index 00000000..51c6c7e7 --- /dev/null +++ b/piclib/picrin/control.scm @@ -0,0 +1,6 @@ +(define-library (picrin control) + (import (picrin base)) + + (define escape call/cc) ; create a new global variable slot + + (export escape))