init.tcl

The main file sourced by a Tcl interpreter when starting up (during Tcl_Init). See the library manpage for more info:

Has in recent versions become more important for providing the core language environment, as some core commands (clock, info, string) that used to be implemented in C throughout are now namespace ensembles set up in init.tcl.

See also:


init.tcl is very well-documented, as usual with Tcl, and worth reading if you're interested. For a quick survey, here are some procs it defines:

# $ egrep '^\s*(namespace\ eval|proc)' /usr/share/tcltk/tcl8.6/init.tcl | sed -e 's/{$/{}/'
namespace eval tcl {}
    namespace eval mathfunc {}
        proc min {args} {}
        proc max {args} {}
    namespace eval tcl {}
        proc EnvTraceProc {lo n1 n2 op} {}
        proc InitWinEnv {} {}
    namespace eval ::tcl::clock [list variable TclLibDir $::tcl_library]
    proc clock args {}
        namespace eval ::tcl::clock [list namespace ensemble create -command \
            proc ::tcl::clock::$cmd args {}
    proc tclLog {string} {}
proc unknown args {}
proc auto_load {cmd {namespace {}}} {}
            namespace eval :: $auto_index($name)
            namespace eval :: $auto_index($name)
proc auto_load_index {} {}
proc auto_qualify {cmd namespace} {}
proc auto_import {pattern} {}
                namespace eval :: $auto_index($name)
proc auto_execok name {}
proc auto_execok name {}
proc tcl::CopyDirectory {action src dest} {}