klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit 5f45908ec6f1d272a3f2dad962879b50b817c0fa
parent 12857fa47148b10fa3a77f843716904b59935fe8
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Sun, 13 Mar 2011 04:24:44 -0300

Added extend-continuation to the ground environment.

Diffstat:
Msrc/kgcontinuations.h | 3++-
Msrc/kground.c | 2+-
Msrc/krepl.c | 2+-
Msrc/kstate.c | 3+++
4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/kgcontinuations.h b/src/kgcontinuations.h @@ -25,7 +25,8 @@ void call_cc(klisp_State *K, TValue *xparams, TValue ptree, TValue denv); /* 7.2.3 extend-continuation */ -/* TODO */ +void extend_continuation(klisp_State *K, TValue *xparams, TValue ptree, + TValue denv); /* 7.2.4 guard-continuation */ /* TODO */ diff --git a/src/kground.c b/src/kground.c @@ -356,7 +356,7 @@ void kinit_ground_env(klisp_State *K) add_applicative(K, ground_env, "call/cc", call_cc, 0); /* 7.2.3 extend-continuation */ - /* TODO */ + add_applicative(K, ground_env, "extend_continuation", extend_continuation, 0); /* 7.2.4 guard-continuation */ /* TODO */ diff --git a/src/krepl.c b/src/krepl.c @@ -96,7 +96,7 @@ void error_fn(klisp_State *K, TValue *xparams, TValue obj) char *str = ttisstring(obj)? kstring_buf(obj) : "not a string passed to error continuation"; - fprintf(stderr, "\n*ERRROR*: %s\n", str); + fprintf(stderr, "\n*ERROR*: %s\n", str); TValue denv = xparams[0]; create_loop(K, denv); diff --git a/src/kstate.c b/src/kstate.c @@ -120,6 +120,9 @@ klisp_State *klisp_newstate (klisp_Alloc f, void *ud) { return K; } +/* GC: should probably save the cont to retain the objects in + xparams in case of gc (Also useful for source code info) + probably a new field in K called active_cont */ void kcall_cont(klisp_State *K, TValue dst_cont, TValue obj) { /* TODO: interceptions */