From: Christian W. <Chr...@t-...> - 2025-05-19 16:42:27
|
On 05/19/2025 05:24 PM, Donald G Porter via Tcl-Core wrote: > On 5/19/25 11:10, Christian Werner wrote: >> On 5/19/25 14:31, Christian Werner wrote: >> … >> Massimo Manghi gave me his proposal "package names -loaded" which IMO is >> a very good choice as it smoothly fits into the current implementation of >> "package names". So the "-loaded" option simply modifies the if-condition >> whose block appends to the result list. Streamlined. > > The existing command is [package names] with no arguments accepted. > > What do you think of adding two optional argument values: > > [package names provided] -- return names of packages provided in the current interp. > > [package names available] -- return names of packages where some "ifneeded" script has been found. > > and > > [package names] -- continue to return the union of the lists described above. > > This reuses the "provide" verbiage already part of [package], and avoids confusion > with the "-loaded" term that better belongs with [load], etc. Good point, Don. So may I ask Ashok again to update the TIP entry to ---8><---8><--- # TIP 722: Improve **package names** subcommand Author: Christian Werner <und...@gm...> Tcl-Version: 9.1 State: Draft Type: Project Created: 19-May-2025 Keywords: Tcl,package ----- # Abstract This TIP proposes to improve the **package names** subcommand such that its result list can be filtered with respect to packages which are provided (i.e. present) and packages which are not provided, but for which a **package ifneeded** script is available. # Rationale Although the **package names** subcommand returns a list of all currently provided and available packages there's no equivalent to retrieve only the list of currently provided (i.e. present) packages. However, the latter can be of use e.g. to build a software bill of materials of an application or to help in generating a package dependency graph. # Specification For **package names** without any further arguments (current default mode of operation) the result list is made up of package names which are provided or for which a **package ifneeded** script is available. For **package names available** the list contains only the packages which are not provided (i.e. not present) but for which a **package ifneeded** script is available. For **package names provided** the list contains only the currently provided (i.e. present) packages. # Implementation TBD. # Copyright This document has been placed in the public domain. ---8><---8><--- Thank you, Christian |