Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a2cb16784aefb8b3a94f1d9f9cad7981d95df98b
Ticket: 218318ffffffffffffffffffffffffffffffffff
package ifneeded does not function
User & Date: nobody on 2000-10-26 00:56:06
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 3796 Bug
    Version: 1.2
    SubmitDate: '1999-12-07'
    LastModified: '1999-12-07'
    Severity: SER
    Status: Closed
    Submitter: techsupp
    ChangedBy: hobbs
    OS: Solaris
    FixedDate: '2000-10-25'
    ClosedDate: '1999-12-07'
    
    
    Name:
    Chia-Wei Chow
    
    ReproducibleScript:
    i have 3 packages in /tmp/lib each as a pkgIndex.tcl file in it
    
    cat /tmp/lib/a1.0/pkgIndex.tcl
    package ifneeded A 1.0 [list
            puts "hello from A!"
            package provide A 1.0 ]
    
    cat /tmp/lib/b1.0/pkgIndex.tcl
    package ifneeded B 1.0 [list
            puts "hello from B!"
            package provide B 1.0 ]
    
    cat /tmp/lib/c1.0/pkgIndex.tcl
    package ifneeded C 1.0 [list
            puts "hello from C!"
            package provide C 1.0 ]
    
    here's my main tcl script file:
    
    lappend auto_path /tmp/lib
    puts [package require A]
    
    
    when i run "protclsh80 mine.tcl", here's what i got
    hello from B!
    hello from C!
    hello from A!
    1.0
    
    ObservedBehavior:
    i didn't expect to see
    hello from B!
    hello from C!
    
    DesiredBehavior:
    i would expect getting
    hello from A!
    1.0
    
    
    
    When it runs through finding an unknown package, it will source
    all the found pkgIndex.tcl files, so it doesn't have to do it
    again later (unless auto_path changes).  Thus, all the files
    will get evaluated, then it will look to see if 'A' is defined. 
    -- 12/07/1999 hobbs
    
  4. foundin changed to: "final: 8.0.5"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "56. LibTomMath"
  10. title changed to: "package ifneeded does not function"
  11. type changed to: "Bug"