Wapp

Artifact [730a1d9b01]
Login

Artifact 730a1d9b01abf729c8e454779c696c3ed92d9608182b6afeeed168c57981f625:

Ticket change [730a1d9b01] - New ticket [231e1accd3] Add pkgIndex.tcl. by anonymous 2023-09-06 07:54:33. (unpublished)
D 2023-09-06T07:54:33.910
J foundin 1.0
J icomment The\sdocumentation\smentions\sthat\sif\syou\swant\sto\sbe\sable\sto\s`package\srequire\swapp`\sdirectly,\syou\sshould\sbuild\s`wapptclsh`.\sHowever\sit's\salso\svery\seasy\s(and\sI\swould\sargue\svery\suseful)\sto\sset\sup\swapp\sto\sbe\sdirectly\scompatible\swith\svanilla\s`tclsh`.\sIf\syou\sput\sa\s`pkgIndex.tcl`\sfile\sin\sthe\sroot\sdir\swith\sthe\sfollowing\scontents:\r\n\r\n`package\sifneeded\swapp\s1.0\s[list\ssource\s[file\sjoin\s$dir\swapp.tcl]]`\r\n\r\n...\sand\smake\ssure\sthe\sroot\sdir\sis\sdirectly\sor\sindirectly\sin\s[auto_path](https://wiki.tcl-lang.org/page/auto_path),\swapp\swill\sact\sas\sa\snormal\sTcl\spackage.\r\n\r\nIf\syou\sput\sthe\s`pkgIndex.tcl`\sfile\sand\sthe\sfollowing\s`testwapp.tcl`\sfile\sinside\sthe\sroot\sdir:\r\n\r\n\s\s\s\slappend\sauto_path\s[file\sdirname\s[info\sscript]]\r\n\s\s\s\s\r\n\s\s\s\spackage\srequire\swapp\r\n\s\s\s\s\r\n\s\s\s\sproc\swapp-default\s{}\s{\r\n\s\s\s\s\s\swapp-subst\s{<h1>Hello,\sWorld!</h1>\\n}\r\n\s\s\s\s}\r\n\s\s\s\swapp-start\s$argv\r\n\r\n\r\nYou\scan\sget\sa\s"Hello\sWorld"\spage\swith\sjust\s`tclsh\stestwapp.tcl`.\sIf\syou\sinstall\swapp\sas\sa\ssystem-wide\slibrary\syou\swon't\sneed\sto\stouch\sthe\s`auto_path`\sat\sall,\sthis\sis\sjust\sdone\sfor\stesting\spurposes\shere.\r\n\r\nAdding\sa\s`pkgIndex.tcl`\sfile\swould\smake\swapp's\susage\sidentical\sto\sthat\sof\sother\sTcl\spackages\slike\sthe\sones\sin\sTcllib\sand\swould\smake\sit\seasier\sto\sembed\sit\sin\sa\slarger\sTcl\sapplication.
J login anonymous
J mimetype text/x-markdown
J private_contact 8982a851333466c77485b64f16aa683016dd9fdc
J severity Important
J status Open
J title Add\spkgIndex.tcl
J type Feature_Request
K 231e1accd3b5c1bb2ccc038bb99161941af9d743
U anonymous
Z 492eb6706b0ff3e21019584f081ed570