Itcl - the [incr Tcl] extension

Check-in [5885edb242]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Disable crackpot code. No substantial harm demonstrated by test suite.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-5ea6971709
Files: files | file ages | folders
SHA1: 5885edb242f8526d034befb501a6660e7435356d
User & Date: dgp 2015-05-22 17:14:48
References
2015-05-29
18:10
[5885edb242] Fix the "unknown" method of Itcl classes so that it is more selective, enabling the C++ declaration inspired syntax [$class $instance] without taking lots of missteps in the presence of unknown methods as well. check-in: ecd708c3c6 user: dgp tags: trunk
Context
2015-05-26
18:23
Fix the "unknown" method of Itcl classes so that it is more selective, enabling the C++ declaration inspired syntax [$class $instance] without taking lots of missteps in the presence of unknown methods as well. Patch takes significant effort to preserve error messages, even when in my judgment they are sub-par, and better ones would be simpler, just for sake of compatibility. This patch leaves test import-2.5 failing due to another bug [f3a2e7407c]. check-in: d2e376ca8b user: dgp tags: bug-5ea6971709
2015-05-22
17:14
Disable crackpot code. No substantial harm demonstrated by test suite. check-in: 5885edb242 user: dgp tags: bug-5ea6971709
2015-05-21
14:00
Remove (buggy and ineffective) screen out of non-implemented methods. Don't want to do this anyway. Remove portion of "unknown" method handler that treats (ItclMemberFunc *) as (ItclDelegatedFunction *). check-in: 3d78d3a91a user: dgp tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/itclBase.c.

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
"set itclClass [::oo::class create ::itcl::clazz]\n"
"::oo::define $itclClass superclass ::oo::class";


static const char *clazzUnknownBody =
"    set mySelf [::oo::Helpers::self]\n"
"    set ns [uplevel 1 ::namespace current]\n"
"    if {[::itcl::is class $mySelf]} {\n"
"        if {[namespace which ${ns}::$m] ne {}} {\n"
"            error \"command \\\"$m\\\" already exists in namespace \\\"$ns\\\"\"\n"
"        }\n"
"    } \n"
"    set myObj [lindex [::info level 0] 0]\n"
"    set myErrorInfo {}\n"
"    set obj {}\n"
"    if {[catch {\n"
"        uplevel 1 [list ::itcl::parser::handleClass $myObj $mySelf $m] $args\n"
"    } obj myErrorInfo]} {\n"
"	return -code error -errorinfo $::errorInfo $obj\n"
"    }\n"
"    return $obj\n";

#define ITCL_IS_ENSEMBLE 0x1

typedef struct ItclCmdsInfo {
    const char *name;
    int flags;
} ItclCmdsInfo;







|
|
|
|
|



|

|
|
|
|







96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
"set itclClass [::oo::class create ::itcl::clazz]\n"
"::oo::define $itclClass superclass ::oo::class";


static const char *clazzUnknownBody =
"    set mySelf [::oo::Helpers::self]\n"
"    set ns [uplevel 1 ::namespace current]\n"
"#    if {[::itcl::is class $mySelf]} {\n"
"#        if {[namespace which ${ns}::$m] ne {}} {\n"
"#            error \"command \\\"$m\\\" already exists in namespace \\\"$ns\\\"\"\n"
"#        }\n"
"#    } \n"
"    set myObj [lindex [::info level 0] 0]\n"
"    set myErrorInfo {}\n"
"    set obj {}\n"
"#    if {[catch {\n"
"        uplevel 1 [list ::itcl::parser::handleClass $myObj $mySelf $m] $args\n"
"#    } obj]} {\n"
"#	return -code error -errorinfo $::errorInfo $obj\n"
"#    }\n"
"#    return $obj\n";

#define ITCL_IS_ENSEMBLE 0x1

typedef struct ItclCmdsInfo {
    const char *name;
    int flags;
} ItclCmdsInfo;

Changes to generic/itclClass.c.

1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455

1456
1457
1458
1459
1460
1461
1462
    ItclClass *iclsPtr = data[1];
    if (result == TCL_OK) {
	if (!(iclsPtr->flags & (ITCL_TYPE|ITCL_WIDGET|ITCL_WIDGETADAPTOR))) {
	    Tcl_ResetResult(interp);
            Tcl_AppendResult(interp, Tcl_GetString(objNamePtr), NULL);
	}
    }

    if (result == TCL_ERROR) {
	Tcl_Obj *objPtr;
	
	(void) Tcl_GetReturnOptions(interp, result);
	objPtr = Tcl_NewStringObj("-level 2", -1);
	if (!(iclsPtr->flags & (ITCL_TYPE|ITCL_WIDGETADAPTOR))) {
	    result = Tcl_SetReturnOptions(interp, objPtr);
	} else {
	    Tcl_SetReturnOptions(interp, objPtr);
	}
    }

    Tcl_DecrRefCount(objNamePtr);
    return result;
}

static int
CallCreateObject(
    ClientData data[],







|











>







1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
    ItclClass *iclsPtr = data[1];
    if (result == TCL_OK) {
	if (!(iclsPtr->flags & (ITCL_TYPE|ITCL_WIDGET|ITCL_WIDGETADAPTOR))) {
	    Tcl_ResetResult(interp);
            Tcl_AppendResult(interp, Tcl_GetString(objNamePtr), NULL);
	}
    }
#if 0
    if (result == TCL_ERROR) {
	Tcl_Obj *objPtr;
	
	(void) Tcl_GetReturnOptions(interp, result);
	objPtr = Tcl_NewStringObj("-level 2", -1);
	if (!(iclsPtr->flags & (ITCL_TYPE|ITCL_WIDGETADAPTOR))) {
	    result = Tcl_SetReturnOptions(interp, objPtr);
	} else {
	    Tcl_SetReturnOptions(interp, objPtr);
	}
    }
#endif
    Tcl_DecrRefCount(objNamePtr);
    return result;
}

static int
CallCreateObject(
    ClientData data[],