• BUG: wrong usage for package loading with multiple versions available

    From aotto1968@21:1/5 to All on Wed Apr 30 12:06:55 2025
    hi,

    The "-exact" option does NOT include the PARTIAL version number. To use the tcltest-2.3.8 package the EXACT version have to be "known".

    The CORE problem is that tcltest-2.3 and tcltest-2-5 have partly DIFFERENT syntax. The command "package require tcltest 2.3" should load the LATEST
    patch level from "tcltest-2.3.X"


    package require Tcl 8.5
    8.5.19
    package versions tcltest
    2.3.8 2.5.3
    info library
    /path/to/lib/tcl8.5
    catch {package require -exact tcltest 2.3} msg
    1
    set msg
    can't find package tcltest exactly 2.3
    package require tcltest 2.3
    2.5.3


    package require Tcl 8.5
    8.6.12
    package versions tcltest
    2.3.8 2.5.3
    info library
    /path/to/lib/tcl8.6
    catch {package require -exact tcltest 2.3} msg
    1
    set msg
    can't find package tcltest exactly 2.3
    package require tcltest 2.3
    2.5.3

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Emiliano@21:1/5 to aotto1968@t-online.de on Wed Apr 30 09:48:25 2025
    On Wed, 30 Apr 2025 12:06:55 +0200
    aotto1968 <aotto1968@t-online.de> wrote:

    hi,

    The "-exact" option does NOT include the PARTIAL version number. To use the tcltest-2.3.8 package the EXACT version have to be "known".

    Not a bug, but a documented feature; -exact means just that.

    If you want the package 2.3.x for all x >= a0, use

    package require tcltest 2.3-2.4

    Regards
    --
    Emiliano

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From aotto1968@21:1/5 to All on Wed Apr 30 19:47:10 2025
    On 30.04.25 19:43, aotto1968 wrote:
    On 30.04.25 18:15, Alan Grunwald wrote:
    On 30/04/2025 11:06, aotto1968 wrote:
    hi,

    The "-exact" option does NOT include the PARTIAL version number. To use the >>> tcltest-2.3.8 package the EXACT version have to be "known".

    The CORE problem is that tcltest-2.3 and tcltest-2-5 have partly DIFFERENT >>> syntax. The command "package require tcltest 2.3" should load the LATEST >>> patch level from "tcltest-2.3.X"


    package require Tcl 8.5
    8.5.19
    package versions tcltest
    2.3.8 2.5.3
    info library
    /path/to/lib/tcl8.5
    catch {package require -exact tcltest 2.3} msg
    1
    set msg
    can't find package tcltest exactly 2.3
    package require tcltest 2.3
    2.5.3


    package require Tcl 8.5
    8.6.12
    package versions tcltest
    2.3.8 2.5.3
    info library
    /path/to/lib/tcl8.6
    catch {package require -exact tcltest 2.3} msg
    1
    set msg
    can't find package tcltest exactly 2.3
    package require tcltest 2.3
    2.5.3
    OK. I'll bite.

     From the manpage,

    "package require -exact package version
    "    This form of the command is used when only the given version of package is acceptable to the caller."

    Since 2.5.3 isn't exactly 2.5, [package require -exact tcltest 2.5] fails is only version 2.5.3 is available.

    The second line of the manpage quote above goes on to state.

    "This command is equivalent to package require package version-version."

    I haven't checked, because I am, frankly, not interested, but

    package require tcltest 2.3-2.3.9 might do what you want.


    ok, lets check


    package require Tcl 8.5
    8.6.12
    package versions tcltest
    2.3.8 2.5.3

    # BUG: 2.3 have to pic-up latest patch of the 2.3
    package require tcltest 2.3
    2.5.3

    # BUG: upper limit does NOT works at all
    package require tcltest -2.3.9
    error: in itpEvalDirect
    expected version number but got ""
    while executing
    "package require tcltest -2.3.9"
    invoked from within
    "interp eval $itp $cmd"

    # BUG: 2.3.8 is NOT of the solution
    package require tcltest 2.3-2.3.8
    error: in itpEvalDirect
    can't find package tcltest 2.3-2.3.8
    while executing
    "package require tcltest 2.3-2.3.8"
    invoked from within
    "interp eval $itp $cmd"

    # OK - only case that works
    package require tcltest 2.3-2.3.9
    2.3.8

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From aotto1968@21:1/5 to Alan Grunwald on Wed Apr 30 19:43:12 2025
    On 30.04.25 18:15, Alan Grunwald wrote:
    On 30/04/2025 11:06, aotto1968 wrote:
    hi,

    The "-exact" option does NOT include the PARTIAL version number. To use the >> tcltest-2.3.8 package the EXACT version have to be "known".

    The CORE problem is that tcltest-2.3 and tcltest-2-5 have partly DIFFERENT >> syntax. The command "package require tcltest 2.3" should load the LATEST
    patch level from "tcltest-2.3.X"


    package require Tcl 8.5
    8.5.19
    package versions tcltest
    2.3.8 2.5.3
    info library
    /path/to/lib/tcl8.5
    catch {package require -exact tcltest 2.3} msg
    1
    set msg
    can't find package tcltest exactly 2.3
    package require tcltest 2.3
    2.5.3


    package require Tcl 8.5
    8.6.12
    package versions tcltest
    2.3.8 2.5.3
    info library
    /path/to/lib/tcl8.6
    catch {package require -exact tcltest 2.3} msg
    1
    set msg
    can't find package tcltest exactly 2.3
    package require tcltest 2.3
    2.5.3
    OK. I'll bite.

    From the manpage,

    "package require -exact package version
    "    This form of the command is used when only the given version of package is acceptable to the caller."

    Since 2.5.3 isn't exactly 2.5, [package require -exact tcltest 2.5] fails is only version 2.5.3 is available.

    The second line of the manpage quote above goes on to state.

    "This command is equivalent to package require package version-version."

    I haven't checked, because I am, frankly, not interested, but

    package require tcltest 2.3-2.3.9 might do what you want.

    ok, lets check

    # BUG "2.3.8" is NOT part of the solution


    package require Tcl 8.5
    8.6.12
    package versions tcltest
    2.3.8 2.5.3

    # BUG: 2.3 have to pic-up latest patch of the 2.3
    package require tcltest 2.3
    2.5.3

    # BUG: upper limit does NOT works at all
    package require tcltest -2.3.9
    error: in itpEvalDirect
    expected version number but got ""
    while executing
    "package require tcltest -2.3.9"
    invoked from within
    "interp eval $itp $cmd"

    # BUG: 2.3.8 is NOT of the solution
    package require tcltest 2.3-2.3.8
    error: in itpEvalDirect
    version conflict for package "tcltest": have 2.5.3, need 2.3-2.3.8
    while executing
    "package require tcltest 2.3-2.3.8"
    invoked from within
    "interp eval $itp $cmd"

    # ONLY case that works
    package require tcltest 2.3-2.3.9
    2.3.8

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Fri May 2 18:33:40 2025
    * aotto1968 <aotto1968@t-online.de>
    | ok, lets check

    I would suggest to read *and understand* the 'package' manpage.

    | package versions tcltest
    | > 2.3.8 2.5.3
    | # BUG: 2.3 have to pic-up latest patch of the 2.3
    | package require tcltest 2.3

    Why? manpage says otherwise:

    A suitable version of the package is any version which satisfies
    at least one of the requirements, per the rules of package vsat-
    isfies. If multiple versions are suitable the implementation
    with the highest version is chosen.

    Note the last sentence.

    | # Bug: upper limit does NOT works at all
    | package require tcltest -2.3.9

    Why should that work at all?

    Each requirement is allowed to have any of the forms:

    min This form is called “min-bounded”.

    min- This form is called “min-unbound”.

    min-max
    This form is called “bounded”.

    There is no '-max' mode.

    | # BUG: 2.3.8 is NOT of the solution
    | package require tcltest 2.3-2.3.8

    As stated in the manpage:

    [2] A version satisfies a “bounded” requirement when

    --<snip-snip>--
    [b] Otherwise if, and only if the version is greater
    than or equal to the min, and less than the max,
    where both min and max have been padded internally
    with “a0”. Note that while the comparison to min
    is inclusive, the comparison to max is exclusive. Note the last sentence.

    | # OK - only case that works
    | package require tcltest 2.3-2.3.9

    As stated in the manpage, same as last point.

    HTH
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From aotto1968@21:1/5 to Ralf Fassel on Sat May 3 16:41:26 2025
    On 02.05.25 18:33, Ralf Fassel wrote:
    * aotto1968 <aotto1968@t-online.de>
    | ok, lets check

    I would suggest to read *and understand* the 'package' manpage.

    | package versions tcltest
    | > 2.3.8 2.5.3
    | # BUG: 2.3 have to pic-up latest patch of the 2.3
    | package require tcltest 2.3

    Why? manpage says otherwise:

    A suitable version of the package is any version which satisfies
    at least one of the requirements, per the rules of package vsat-
    isfies. If multiple versions are suitable the implementation
    with the highest version is chosen.

    Note the last sentence.

    | # Bug: upper limit does NOT works at all
    | package require tcltest -2.3.9

    Why should that work at all?

    Each requirement is allowed to have any of the forms:

    min This form is called “min-bounded”.

    min- This form is called “min-unbound”.

    min-max
    This form is called “bounded”.

    There is no '-max' mode.

    | # BUG: 2.3.8 is NOT of the solution
    | package require tcltest 2.3-2.3.8

    As stated in the manpage:

    [2] A version satisfies a “bounded” requirement when

    --<snip-snip>--
    [b] Otherwise if, and only if the version is greater
    than or equal to the min, and less than the max,
    where both min and max have been padded internally
    with “a0”. Note that while the comparison to min
    is inclusive, the comparison to max is exclusive.
    Note the last sentence.

    | # OK - only case that works
    | package require tcltest 2.3-2.3.9

    As stated in the manpage, same as last point.

    HTH
    R'

    I've already mentioned in the past that a bug written to the documentation is not a non-bug, but rather a "documented bug."

    - If I write "package require 2.3," then I want the LASTEST from 2.3, i.e., 2.3.8.
    - If I write "package require 2," then I want the latest from 2, i.e., 2.5.3, etc.

    mfg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Mon May 5 11:07:10 2025
    * aotto1968 <aotto1968@t-online.de>
    | I've already mentioned in the past that a bug written to the
    | documentation is not a non-bug, but rather a "documented bug."

    IMHO, calling a documented feature a bug is not a good means to get
    anyones attention to change that feature...

    | - If I write "package require 2.3," then I want the LASTEST from 2.3, i.e., 2.3.8.
    | - If I write "package require 2," then I want the latest from 2, i.e., 2.5.3, etc.

    *Headscratch* well, you know how it works... You're a programmer, you
    have the source code, so modify it to suit your needs.

    Or propose a change via a TIP. Best chance if you include the patch
    code, but I doubt that in this particular case it will be accepted...

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)