From 30a867f44b90433d30883b85609c20a2bd647a4b Mon Sep 17 00:00:00 2001 From: "colin.smith" Date: Mon, 16 Jun 2008 17:52:57 +0000 Subject: [PATCH] tweak: add printout of undecipherable #constant to aid in debugging git-svn-id: svn://localhost/root/svnrepo/trunk@12 bee25f81-8ba7-4b93-944d-dfac3d1a11cc --- src/io.cpp | 2 +- src/subr.cpp | 33 +++++++++++++++------------------ 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/io.cpp b/src/io.cpp index 5a997eb..7969489 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -254,7 +254,7 @@ TOP: error ("indecipherable #o constant"); } - error ("indecipherable #constant"); + error ("indecipherable #constant:", lexeme.str()); } else if (c == '"') { diff --git a/src/subr.cpp b/src/subr.cpp index 61ce0a9..a307430 100644 --- a/src/subr.cpp +++ b/src/subr.cpp @@ -1570,22 +1570,20 @@ static Cell* put_property (Context * ctx, Cell * arglist) return unspecified; } -static Cell* get_property (Context * ctx, Cell * arglist) - { - psymbol p = car (arglist)->SymbolValue (); - psymbol q = cadr (arglist)->SymbolValue (); +static Cell* get_property (Context * ctx, Cell * arglist) { + psymbol const p = car (arglist)->SymbolValue (); + psymbol const q = cadr (arglist)->SymbolValue (); - if (p->plist) - for (int ix = 0; ix < p->plist->size (); ++ix) - { - Cell * elt = p->plist->get (ix); - if (car (elt)->SymbolValue () == q) - return cdr (elt); - } - - return ctx->make_boolean (false); + if (p->plist) + for (int ix = 0; ix < p->plist->size (); ++ix) { + Cell * elt = p->plist->get (ix); + if (car (elt)->SymbolValue () == q) + return cdr (elt); } + return ctx->make_boolean (false); +} + // Imported from Common Lisp. Returns #t if the given symbol is // bound in the global environment (lexical bindings are not consulted), // #f otherwise. @@ -1868,11 +1866,10 @@ void Context::provision () SchemeExtension::RunInstall (this, envt); } -void Context::bind_subr (const char * name, subr_f subr) - { - psymbol s = intern (name); - set_var (envt, s, make_subr (subr, name)); - } +void Context::bind_subr (const char * name, subr_f subr) { + psymbol s = intern (name); + set_var (envt, s, make_subr (subr, name)); +} cellvector* SchemeExtension::extensions = 0; SchemeExtension* SchemeExtension::main = 0;