You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3.2 KiB
3.2 KiB
src/lib — Editable Tcl Library Source
Purpose
Source of truth for all editable pkgIndex.tcl-based library packages. These are larger libraries that use the Tcl package index system rather than the .tm module format.
Ownership
- Agents should edit implementation
.tclfiles insrc/lib/subdirectories as the source of truth for library behaviour. pkgIndex.tclfiles are loader maps — treat them as such unless the task is about package loading or registration.
Local Contracts
- Treat
src/lib/as the generic source tree; prefer it oversrc/lib_tcl<major>/unless version-specific. - If a request starts from
pkgIndex.tcl, resolve the mapped implementation file before analyzing or editing a proc. - Libraries here include:
app-punk/— Punk REPL app entry (app-punk::repl)app-punkshell/— Punkshell app entry (app-punkshell); on eof of its input channel theenv(PUNK_PIPE_EOF)policy (exit|interactive|unset=console heuristic) decides between terminating and reopening the console for an interactive repl — automated callers should setexitor end piped input with an explicitexitapp-punkscript/— lean one-shot script runner behind the punk executablescriptsubcommand (G-015): runs a file, alib:<name>scriptlib script (resolved viapunk::path::scriptlib_resolve; an extensionless call also matches an extensionless file whose first lines identify it as tcl -# tclcomment or tcl shebang incl. the sh-trampoline - with the called spelling winning when both spellings exist), or piped stdin in the default punk shell module/alias environment with honest exit codes; no shellfilter stacks or logging side effects, never falls into an interactive shell — the reliable path for automated/agent callers (prefer this over piping intoshell); stdin form echoes the script's final result when non-empty; GUI parity withtclsh— a script leaving a registered Tk main loop is serviced until its window closes (soscript app.tclkeeps a Tk app alive), while console scripts and errored scripts exit immediatelyapp-shellspy/— ShellSpy app entry (app-shellspy)app_shell/— Shell app helpers (app_shell)app_shellrun/— Shell run helpers (app_shellrun)app_project/— Project app helpers (app_project)vfszip/— VFS zip utilities
Work Guidance
- Prefer generic or version-specific source trees over built, installed, VFS, or generated copies unless explicitly targeting those.
- After editing a library, run
tclsh src/make.tcl libsto rebuild, thentclsh src/make.tcl bakehousefor a full rebuild from a clean checkout (the deprecatedprojectalias still maps). - New libraries should include a
pkgIndex.tclthat correctly references the implementation file.
Verification
tclsh src/make.tcl libscompletes without errors.package require <libraryname>resolves in the Punk shell after build.
Child DOX Index
app-punk/— Punk REPL app entryapp-punkshell/— Punkshell app entryapp-punkscript/— One-shot script runner (scriptsubcommand)app-shellspy/— ShellSpy app entryapp_shell/— Shell app helpersapp_shellrun/— Shell run helpersapp_project/— Project app helpersvfszip/— VFS zip utilities