klisp

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

commit abfaf010de22d77a55b33002ed070d7159666f31
parent a6797b816e25681bcaa15c7b3b3b333e91308896
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Thu, 24 Mar 2011 00:15:13 -0300

Added get-current-environment to the ground environment.

Diffstat:
Msrc/kgenvironments.c | 36++++++++++++++++++++++++++++++++++++
Msrc/kgenvironments.h | 31+++++++++++++++++++++++++++++++
Msrc/kground.c | 3++-
3 files changed, 69 insertions(+), 1 deletion(-)

diff --git a/src/kgenvironments.c b/src/kgenvironments.c @@ -70,3 +70,39 @@ void make_environment(klisp_State *K, TValue *xparams, TValue ptree, /* 5.10.1 $let */ /* TODO */ + +/* 6.7.1 $binds? */ +/* TODO */ + +/* 6.7.2 get-current-environment */ +void get_current_environment(klisp_State *K, TValue *xparams, TValue ptree, + TValue denv) +{ + UNUSED(xparams); + check_0p(K, "get-current-environment", ptree); + kapply_cc(K, denv); +} + +/* 6.7.3 make-kernel-standard-environment */ +/* TODO */ + +/* 6.7.4 $let* */ +/* TODO */ + +/* 6.7.5 $letrec */ +/* TODO */ + +/* 6.7.6 $letrec* */ +/* TODO */ + +/* 6.7.7 $let-redirect */ +/* TODO */ + +/* 6.7.8 $let-safe */ +/* TODO */ + +/* 6.7.9 $remote-eval */ +/* TODO */ + +/* 6.7.10 $bindings->environment */ +/* TODO */ diff --git a/src/kgenvironments.h b/src/kgenvironments.h @@ -35,4 +35,35 @@ void make_environment(klisp_State *K, TValue *xparams, TValue ptree, /* 5.10.1 $let */ /* TODO */ +/* 6.7.1 $binds? */ +/* TODO */ + +/* 6.7.2 get-current-environment */ +void get_current_environment(klisp_State *K, TValue *xparams, TValue ptree, + TValue denv); + +/* 6.7.3 make-kernel-standard-environment */ +/* TODO */ + +/* 6.7.4 $let* */ +/* TODO */ + +/* 6.7.5 $letrec */ +/* TODO */ + +/* 6.7.6 $letrec* */ +/* TODO */ + +/* 6.7.7 $let-redirect */ +/* TODO */ + +/* 6.7.8 $let-safe */ +/* TODO */ + +/* 6.7.9 $remote-eval */ +/* TODO */ + +/* 6.7.10 $bindings->environment */ +/* TODO */ + #endif diff --git a/src/kground.c b/src/kground.c @@ -443,7 +443,8 @@ void kinit_ground_env(klisp_State *K) /* TODO */ /* 6.7.2 get-current-environment */ - /* TODO */ + add_applicative(K, ground_env, "get-current-environment", + get_current_environment, 0); /* 6.7.3 make-kernel-standard-environment */ /* TODO */