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)
commitefee121d8db22043e295d65a80ec3486ee0ac6fb (patch)
tree652c18c95e51b2d10f06d292f095643d11f1936e /library
parent8482cde58cabe42d58e50e08a72e9b78298df93c (diff)
downloadtcl-efee121d8db22043e295d65a80ec3486ee0ac6fb.zip
tcl-efee121d8db22043e295d65a80ec3486ee0ac6fb.tar.gz
tcl-efee121d8db22043e295d65a80ec3486ee0ac6fb.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.