Tcl Source Code

Check-in [8e666511a8]
Login

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

Overview
Comment:Comment updated
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip490-msgcat-oo-2
Files: files | file ages | folders
SHA3-256: 8e666511a80f4630e770535d25684771d1a7fde97460d1a171018afb33deb0be
User & Date: oehhar 2018-01-16 14:53:41
Context
2018-03-12
13:48
msgcat 1.7 uses [tailcall], so requires Tcl 8.6. Closed-Leaf check-in: 699af4b725 user: dgp tags: tip490-msgcat-oo-2
2018-01-16
14:53
Comment updated check-in: 8e666511a8 user: oehhar tags: tip490-msgcat-oo-2
14:13
Solve case where msgcat is called within a class definition script (works only for 8.7) check-in: 106a596741 user: oehhar tags: tip490-msgcat-oo-2
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to library/msgcat/msgcat.tcl.

1140
1141
1142
1143
1144
1145
1146
1147
1148

1149
1150
1151
1152
1153
1154
1155
1156
    if {[string length $modifier]} {
	append ret _$modifier
    }
    return $ret
}

# helper function to find package namespace of stack-frame -2
# There are 3 possibilities:
# - called from a proc

# - called from a oo class
# - called from a classless oo object
proc ::msgcat::PackageNamespaceGet {} {
    uplevel 2 {
	# Check for no object
	switch -exact -- [namespace which self] {
	    {::oo::define::self} {
		# We are within a class definition







|

>
|







1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
    if {[string length $modifier]} {
	append ret _$modifier
    }
    return $ret
}

# helper function to find package namespace of stack-frame -2
# There are 4 possibilities:
# - called from a proc
# - called within a class definition script
# - called from an class defined oo object
# - called from a classless oo object
proc ::msgcat::PackageNamespaceGet {} {
    uplevel 2 {
	# Check for no object
	switch -exact -- [namespace which self] {
	    {::oo::define::self} {
		# We are within a class definition