Index: 3.99.4.21/Src/tcl-obj.c --- 3.99.4.21/Src/tcl-obj.c Mon, 28 Dec 1998 23:05:11 +0100 eg (STk/X/51_tcl-obj.c 1.8 644) +++ 3.99.5.10(w)/Src/tcl-obj.c Mon, 10 May 1999 19:05:15 +0200 eg (STk/X/51_tcl-obj.c 1.9 644) @@ -3,7 +3,7 @@ * t c l - o b j . c - Implementation of the (crazy) Tcl_obj functions * in the Scheme interpreeter * - * Copyright © 1997-1998 Erick Gallesio - I3S-CNRS/ESSI + * Copyright © 1997-1999 Erick Gallesio - I3S-CNRS/ESSI * * * Permission to use, copy, and/or distribute this software and its @@ -21,13 +21,14 @@ * * Author: Erick Gallesio [eg@unice.fr] * Creation date: 8-Jul-1997 10:33 - * Last file update: 27-Dec-1998 20:47 + * Last file update: 10-May-1999 19:05 * */ #include "stk.h" #ifdef USE_TK # include "tk-glue.h" +# include "module.h" #else # include "tcl-glue.h" #endif @@ -720,41 +721,22 @@ * commands to execute. */ { SCM cmd = TCLOBJDATA((SCM) objPtr); + int res; - panic("ON est dans TclEvalObj"); - getchar(); -#ifdef FIXME_FIXME - if (cmd) { - SCM expr = STk_convert_tcl_list_to_scheme(cmd); - Jmp_Buf jb, *prev_jb = Top_jmp_buf; - long prev_context = Error_context; - SCM result; - int k; - - /* save normal error jmpbuf so that eval error don't lead to toplevel */ - /* If in a "catch", keep the ERR_IGNORED bit set */ - if ((k = setjmp(jb.j)) == 0) { - Top_jmp_buf = &jb; - Error_context = (Error_context & ERR_IGNORED) | ERR_TCL_BACKGROUND; - result = STk_eval(expr, NIL); - } - - Top_jmp_buf = prev_jb;;e - Error_context = prev_context; - - if (k == 0) { - Tcl_SetObjResult(interp, STk_create_tcl_object(result)); - return TCL_OK; - } - /* if we are here, an error has occured during the string reading - * Two cases: - * - we are in a catch. Do a longjump to the catch to signal it a fail - * - otherwise error has already signaled, just return EVAL_ERROR - */ - if (Error_context & ERR_IGNORED) longjmp(Top_jmp_buf->j, k); - return TCL_ERROR; - } -#endif - return TCL_OK; + PUSH_ERROR_HANDLER + { + SCM expr = STk_convert_tcl_list_to_scheme(cmd); + + /* Do as if we had a catch around the expression */ + STk_err_handler->context |= ERR_IGNORED; + STk_eval(expr, MOD_ENV(STk_Tk_module)); + res = TCL_OK; + } + WHEN_ERROR + { + res = TCL_ERROR; + } + POP_ERROR_HANDLER; + return res; } #endif