pkg::create(3tcl)

πŸ“¦
version 9.0.4 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ pkg::create ✨

okay bestie, welcome to the pkg::create page from the Tcl built-in commands manual πŸ’– this one's short and sweet and honestly kinda iconic.


🌸 NAME 🌸

pkg::create β€” build a whole 'package ifneeded' command for a package spec you hand it. it's giving matchmaker for packages fr fr πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

::pkg::create -name packageName -version packageVersion ?-load filespec?
... ?-source filespec? ...

πŸ’œ DESCRIPTION πŸ’œ

so ::pkg::create is a utility procedure, and it lives right in the standard Tcl library β€” she's part of the family 🫢. her whole job is to create an appropriate package ifneeded command for a given package specification. that's it. that's the gig.

and why do we care? because you can use her to construct a pkgIndex.tcl file for use with the package mechanism. yes bestie, the actual package mechanism. main character energy ✨


πŸŽ€ OPTIONS πŸŽ€

the parameters she supports are:

  • -name packageName β€” this one sets the name of the package. it's required, no skipping, no cap πŸ’€
  • -version packageVersion β€” this one sets the version of the package. also required babe, both of them, always 🌸
  • -load filespec β€” this one says "hey, here's a library that must be loaded with the load command." and filespec is a list with two elements:
    • the first element is the name of the file to load πŸ“
    • the second element is optional, and it's a list of commands supplied by loading that file
    • if that list of procedures is empty or just... not there, then ::pkg::create will set up the library for direct loading (peep pkg_mkIndex for the lore πŸ‘€)
    • you can throw in any number of -load parameters, go off ✨
  • -source filespec β€” basically the same vibe as -load, except this one specifies a Tcl library that must be loaded with the source command instead. and yes, any number of -source parameters may be specified πŸ’–
okay real talk though: at least one -load or -source parameter must be given. you can't just show up with a name and a version and nothing else, that's not the move 😭

πŸ”₯ SEE ALSO πŸ”₯

package(3tcl)


πŸ‘‘ KEYWORDS πŸ‘‘

auto-load, index, package, version


and that's the whole page bestie, short king behavior but she gets the job done πŸ’…βœ¨

this was the Tcl 8.3 era of the manual, page pkg::create(3tcl) β€” mwah, sending you off with a πŸŽ€ and a πŸ¦‹, go build that pkgIndex.tcl iykyk πŸ’–

πŸ“¦ where this page comes from