Tcl Library Source Code

Check-in [b2bac59979]
Login

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

Overview
Comment:Changes to the namespacex module to remove test case failures. Because of the use of the "try" command in one of the subcommands of the module, tests failed on Tcl 8.5. Added conditional package require for the tcllib implementation of the "try" command if it is not found (i.e. if testing under a pre-8.6 interpreter).
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | pooryorick | gam-namespacex-improve
Files: files | file ages | folders
SHA3-256: b2bac59979ffe04a179acf9cec26fac980b038def0d6a232ab769d4f968b65ce
User & Date: andrewm 2018-12-09 21:00:13.890
Context
2018-12-10
02:46
Fixed version mismatch between code and index, and in the docs. Closed-Leaf check-in: 1d8d51de9c user: aku tags: pooryorick, gam-namespacex-improve
2018-12-09
21:00
Changes to the namespacex module to remove test case failures. Because of the use of the "try" command in one of the subcommands of the module, tests failed on Tcl 8.5. Added conditional package require for the tcllib implementation of the "try" command if it is not found (i.e. if testing under a pre-8.6 interpreter). check-in: b2bac59979 user: andrewm tags: pooryorick, gam-namespacex-improve
2018-12-07
23:23
Improvements to namespacex module. 1. Corrected bug in import command. 2. Incremented version number to 0.2 since the import command was added at some point in time. 3. Added documentation for the hook commands. 4. Added documentation for the import command. 5. Added test cases for the hook and import commands. 6. Reworked some of the command descriptions to add more precise information. check-in: 0c13951b59 user: andrewm tags: pooryorick, gam-namespacex-improve
Changes
Unified Diff Ignore Whitespace Patch
Changes to modules/namespacex/namespacex.tcl.
9
10
11
12
13
14
15







16
17
18
19
20
21
22
# namespacex info  - Get all variables/children, direct and indirect
# namespacex state - Save/restore the variable-based state of namespaces.

# # ## ### ##### ######## ############# ######################
## Requisites

package require Tcl 8.5  ; # namespace ensembles, {*}








namespace eval ::namespacex {
    namespace export add hook import info normalize strip state
    namespace ensemble create

    namespace eval hook {
	namespace export add proc on next







>
>
>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# namespacex info  - Get all variables/children, direct and indirect
# namespacex state - Save/restore the variable-based state of namespaces.

# # ## ### ##### ######## ############# ######################
## Requisites

package require Tcl 8.5  ; # namespace ensembles, {*}

# The try command is used in the namespacex::import command. For backward
# compatibility we will use the try package from tcllib if running
# on a platform that does not have it as a core command, i.e. before 8.6.
if {[llength [info commands try]] == 0} {
    package require try ; # tcllib
}

namespace eval ::namespacex {
    namespace export add hook import info normalize strip state
    namespace ensemble create

    namespace eval hook {
	namespace export add proc on next