X-Git-Url: http://git.hcoop.net/bpt/guile.git/blobdiff_plain/8b66aa8f5496a515ca133d6d2c37a06f6ec1720d..110ef00ba1dfae4461afdd189fed4dfec05ee137:/libguile/debug.c diff --git a/libguile/debug.c b/libguile/debug.c index 1a5c197ee..87513bf48 100644 --- a/libguile/debug.c +++ b/libguile/debug.c @@ -1,5 +1,5 @@ /* Debugging extensions for Guile - * Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2006, 2008, 2009, 2010, 2011 Free Software Foundation + * Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2006, 2008, 2009, 2010, 2011, 2012 Free Software Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -144,16 +144,9 @@ SCM_DEFINE (scm_procedure_source, "procedure-source", 1, 0, 0, if (scm_is_true (src)) return src; - switch (SCM_TYP7 (proc)) { - case scm_tcs_struct: - if (!SCM_STRUCT_APPLICABLE_P (proc) - || SCM_IMP (SCM_STRUCT_PROCEDURE (proc))) - break; - proc = SCM_STRUCT_PROCEDURE (proc); + if (SCM_STRUCTP (proc) && SCM_STRUCT_APPLICABLE_P (proc) + && SCM_HEAP_OBJECT_P ((proc = SCM_STRUCT_PROCEDURE (proc)))) continue; - default: - break; - } } while (0); @@ -206,6 +199,17 @@ SCM_DEFINE (scm_debug_hang, "debug-hang", 0, 1, 0, #undef FUNC_NAME #endif +SCM +scm_local_eval (SCM exp, SCM env) +{ + static SCM local_eval_var = SCM_BOOL_F; + + if (scm_is_false (local_eval_var)) + local_eval_var = scm_c_public_variable ("ice-9 local-eval", "local-eval"); + + return scm_call_2 (SCM_VARIABLE_REF (local_eval_var), exp, env); +} + static void init_stack_limit (void) {