diff --git a/Makefile b/Makefile index 01e3647c..89fce44a 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,8 @@ all: chibi-scheme$(EXE) libs COMPILED_LIBS := lib/srfi/27/rand$(SO) lib/srfi/33/bit$(SO) \ lib/srfi/69/hash$(SO) lib/srfi/98/env$(SO) lib/chibi/ast$(SO) \ lib/chibi/net$(SO) lib/chibi/filesystem$(SO) lib/chibi/process$(SO) \ - lib/chibi/time$(SO) lib/chibi/system$(SO) lib/chibi/heap-stats$(SO) + lib/chibi/time$(SO) lib/chibi/system$(SO) lib/chibi/heap-stats$(SO) \ + lib/chibi/disasm$(SO) libs: $(COMPILED_LIBS) diff --git a/README b/README index 7c399df0..cfbdc524 100644 --- a/README +++ b/README @@ -72,7 +72,10 @@ The essential functions to remember are: A minimal module system is provided by default. Currently you can load the following SRFIs with (import (srfi N)): - 1, 2, 6, 8, 9, 11, 16, 26, 69 + 0, 1, 2, 6, 8, 9, 11, 16, 26, 27, 33, 46, 62, 69, 98 + +although 0, 46 and 62 are built into the default environment so +there's no need to import them. LOAD is extended to accept an optional environment argument, like EVAL. You can also LOAD shared libraries in addition to Scheme source diff --git a/eval.c b/eval.c index 0c87270d..e5cf340c 100644 --- a/eval.c +++ b/eval.c @@ -8,12 +8,16 @@ static int scheme_initialized_p = 0; -#if SEXP_USE_DEBUG -#include "opt/debug.c" -#else -#define print_stack(...) -#define print_bytecode(...) -#define sexp_disasm(...) +#if SEXP_USE_DEBUG_VM +static void sexp_print_stack (sexp ctx, sexp *stack, int top, int fp, sexp out) { + int i; + if (! sexp_oport(out)) out = sexp_current_error_port(ctx); + for (i=0; i