diff options
author | Kevin B Kenny <kennykb@acm.org> | 2004-08-18 19:58:56 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2004-08-18 19:58:56 (GMT) |
commit | fab56e2415bbbc5e2355f500b28d26c5e907ef29 (patch) | |
tree | 0bfbd9e68acb81b08b317b956ce8ac4cca0824cd /library/init.tcl | |
parent | dcdb6368302f0bb38e0d11e8c2d346b684507b07 (diff) | |
download | tcl-fab56e2415bbbc5e2355f500b28d26c5e907ef29.zip tcl-fab56e2415bbbc5e2355f500b28d26c5e907ef29.tar.gz tcl-fab56e2415bbbc5e2355f500b28d26c5e907ef29.tar.bz2 |
TIP #173 and #209 implementation - see ChangeLog for details
Diffstat (limited to 'library/init.tcl')
-rw-r--r-- | library/init.tcl | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/library/init.tcl b/library/init.tcl index 21b3377..761aa4a 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -3,11 +3,12 @@ # Default system startup file for Tcl-based applications. Defines # "unknown" procedure and auto-load facilities. # -# RCS: @(#) $Id: init.tcl,v 1.63 2004/06/16 21:20:42 dgp Exp $ +# RCS: @(#) $Id: init.tcl,v 1.64 2004/08/18 19:59:00 kennykb Exp $ # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 Scriptics Corporation. +# Copyright (c) 2004 by Kevin B. Kenny. All rights reserved. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -743,3 +744,38 @@ proc tcl::CopyDirectory {action src dest} { } return } + +# Set up the 'clock' ensemble + +if { ![interp issafe] } { + + namespace eval ::tcl::clock \ + [list variable TclLibDir [file dirname [info script]]] + + namespace eval ::tcl::clock { + namespace ensemble create -command ::clock \ + -subcommands { + add clicks format + microseconds milliseconds + scan seconds + } + + # Auto-loading stub for 'clock.tcl' + + proc add args { + variable TclLibDir + source -encoding utf-8 [file join $TclLibDir clock.tcl] + return [uplevel 1 [info level 0]] + } + proc format args { + variable TclLibDir + source -encoding utf-8 [file join $TclLibDir clock.tcl] + return [uplevel 1 [info level 0]] + } + proc scan args { + variable TclLibDir + source -encoding utf-8 [file join $TclLibDir clock.tcl] + return [uplevel 1 [info level 0]] + } + } +} |