summaryrefslogtreecommitdiffstats
path: root/library/init.tcl
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-18 11:04:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-18 11:04:07 (GMT)
commit877d7934df687cd8d0c49a794a2fa755663b5e74 (patch)
tree54ddea912709b609790a7fd2142d303ac5b81011 /library/init.tcl
parent63224392940dee1706ff8d6014ae2f0658e50f0d (diff)
parent907b916cca8d7416964c4294cd1679e3c458ec3a (diff)
downloadtcl-877d7934df687cd8d0c49a794a2fa755663b5e74.zip
tcl-877d7934df687cd8d0c49a794a2fa755663b5e74.tar.gz
tcl-877d7934df687cd8d0c49a794a2fa755663b5e74.tar.bz2
TIP #688 implementation. Same as "sebres-9-0-clock-speedup-cr2-no-configure", but without TIP #689's "unknown" handler.
Diffstat (limited to 'library/init.tcl')
-rw-r--r--library/init.tcl23
1 files changed, 9 insertions, 14 deletions
diff --git a/library/init.tcl b/library/init.tcl
index 6500d8e..1209619 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -109,22 +109,17 @@ if {[interp issafe]} {
# Set up the 'clock' ensemble
- namespace eval ::tcl::clock [list variable TclLibDir $::tcl_library]
-
- proc ::tcl::initClock {} {
- # Auto-loading stubs for 'clock.tcl'
-
- foreach cmd {add format scan} {
- proc ::tcl::clock::$cmd args {
- variable TclLibDir
- source [file join $TclLibDir clock.tcl]
- return [uplevel 1 [info level 0]]
- }
+ proc clock args {
+ set cmdmap [dict create]
+ foreach cmd {add clicks format microseconds milliseconds scan seconds} {
+ dict set cmdmap $cmd ::tcl::clock::$cmd
}
-
- rename ::tcl::initClock {}
+ namespace inscope ::tcl::clock [list namespace ensemble create -command \
+ [uplevel 1 [list ::namespace origin [::lindex [info level 0] 0]]] \
+ -map $cmdmap]
+ ::tcl::unsupported::clock::configure -init-complete
+ uplevel 1 [info level 0]
}
- ::tcl::initClock
}
# Conditionalize for presence of exec.