Index: ChangeLog =================================================================== diff -u -r99bd33b963fde1d8c93383fab145234724f2f063 -r9908c8760bc77e7801e462c525f37cefc13dbdcc --- ChangeLog (.../ChangeLog) (revision 99bd33b963fde1d8c93383fab145234724f2f063) +++ ChangeLog (.../ChangeLog) (revision 9908c8760bc77e7801e462c525f37cefc13dbdcc) @@ -1,3 +1,8 @@ +2008-06-03 + * check in guards for boolean values, not for + integer values, such that a guard {true} means + success (many thanks to Neophytos for reporting) + 2008-05-30 * updating language reference @@ -8,7 +13,7 @@ 2008-05-28 * make "info (inst)?forward -definition name" more robust (provide an - error message, if is nog given + error message, if is not given * New info subcommands "info parametercmd" and "info instparametercmd" * export *parametercmds in Serializer, use "-noinit" on slots as well Index: generic/predefined.h =================================================================== diff -u -raeac917db741ab7500d7e976443ac551f191efcd -r9908c8760bc77e7801e462c525f37cefc13dbdcc --- generic/predefined.h (.../predefined.h) (revision aeac917db741ab7500d7e976443ac551f191efcd) +++ generic/predefined.h (.../predefined.h) (revision 9908c8760bc77e7801e462c525f37cefc13dbdcc) @@ -529,8 +529,7 @@ "return $v}\n" "::xotcl::Object instproc method {name arguments body} {\n" "my proc name $arguments $body }\n" -"::xotcl::Class instproc method {\n" -"-per-object:switch name arguments body} {\n" +"::xotcl::Class instproc method {-per-object:switch name arguments body} {\n" "if {${per-object}} {\n" "my proc $name $arguments $body} else {\n" "my instproc $name $arguments $body}}\n" Index: generic/xotcl.c =================================================================== diff -u -r99bd33b963fde1d8c93383fab145234724f2f063 -r9908c8760bc77e7801e462c525f37cefc13dbdcc --- generic/xotcl.c (.../xotcl.c) (revision 99bd33b963fde1d8c93383fab145234724f2f063) +++ generic/xotcl.c (.../xotcl.c) (revision 9908c8760bc77e7801e462c525f37cefc13dbdcc) @@ -2847,23 +2847,16 @@ checkConditionInScope(Tcl_Interp *interp, Tcl_Obj *condition) { int result, success; Tcl_Obj *ov[2]; + ov [1] = condition; + INCR_REF_COUNT(condition); - /* - fprintf(stderr, "----- evaluating condition '%s'\n", ObjStr(condition)); - */ result = XOTcl_ExprObjCmd(NULL, interp, 2, ov); DECR_REF_COUNT(condition); - /* - fprintf(stderr, "----- running condition '%s', result=%d '%s'\n", - ObjStr(condition), result, - ObjStr(Tcl_GetObjResult(interp))); - */ + if (result == TCL_OK) { - result = Tcl_GetIntFromObj(interp, Tcl_GetObjResult(interp),&success); - /* - fprintf(stderr, " success=%d\n", success); - */ + result = Tcl_GetBooleanFromObj(interp, Tcl_GetObjResult(interp),&success); + if (result == TCL_OK && success == 0) result = XOTCL_CHECK_FAILED; }