summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2017-05-10 12:29:54 (GMT)
committersebres <sebres@users.sourceforge.net>2017-05-10 12:29:54 (GMT)
commit3fe213e03172327d71bc8a7b2d174b5887434738 (patch)
tree652c18c95e51b2d10f06d292f095643d11f1936e /library
parentd9b0bec7d68dc00ac744a5a0e3d0ba5d7d8404f1 (diff)
downloadtcl-3fe213e03172327d71bc8a7b2d174b5887434738.zip
tcl-3fe213e03172327d71bc8a7b2d174b5887434738.tar.gz
tcl-3fe213e03172327d71bc8a7b2d174b5887434738.tar.bz2
Ensemble "clock" fixed after merge with kbk's clock ensemble solution. All commands (including new) compiled now also in ensemble (implemented without TclMakeEnsemble, because it can be extended via new map entries).
Ensemble handling partially cherry-picked from new performance branch (TODO: check temporary "-compile" option can be reverted if it becomes ready/merged).
Diffstat (limited to 'library')
-rw-r--r--library/init.tcl15
1 files changed, 11 insertions, 4 deletions
diff --git a/library/init.tcl b/library/init.tcl
index 87e84e4..824f66f 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -45,6 +45,7 @@ if {![info exists auto_path]} {
set auto_path ""
}
}
+
namespace eval tcl {
variable Dir
foreach Dir [list $::tcl_library [file dirname $::tcl_library]] {
@@ -169,9 +170,16 @@ if {[interp issafe]} {
namespace eval ::tcl::clock [list variable TclLibDir $::tcl_library]
- proc ::tcl::initClock {} {
- # Auto-loading stubs for 'clock.tcl'
+ proc clock args {
+ set cmdmap [dict create]
+ foreach cmd {add clicks format microseconds milliseconds scan seconds configure} {
+ dict set cmdmap $cmd ::tcl::clock::$cmd
+ }
+ namespace eval ::tcl::clock [list namespace ensemble create -command \
+ [uplevel 1 [list namespace origin [lindex [info level 0] 0]]] \
+ -map $cmdmap -compile 1]
+ # Auto-loading stubs for 'clock.tcl'
foreach cmd {mcget LocalizeFormat SetupTimeZone GetSystemTimeZone} {
proc ::tcl::clock::$cmd args {
variable TclLibDir
@@ -180,9 +188,8 @@ if {[interp issafe]} {
}
}
- rename ::tcl::initClock {}
+ return [uplevel 1 [info level 0]]
}
- ::tcl::initClock
}
# Conditionalize for presence of exec.