Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8996693b9865902a2b8b71b514f1a0b9fc42ffaf
Ticket: 86ceb4e2b63cfcee65abade0ed16c9ce846b4e30
package require searching module path in wrong order
User & Date: anonymous on 2013-07-15 05:47:53
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/html"
  4. comment changed to:
    The <a href="https://www.tcl.tk/man/tcl8.6/TclCmd/tm.htm#M5">tm documentation</a> says that a module should be loaded from the module path by looking from the first in the list to the last.  However I find that the opposite is happening.  The problem can be demonstrated as so:<br />
    <br />
    If I do:<br />
    <pre>  <code>::tcl::tm::path list</code></pre>
    <br />
    I get:<br /> 
    <pre>  <code>/usr/lib/tcltk/tcl8/site-tcl /usr/lib/tcltk/tcl8/8.0
      /usr/lib/tcltk/tcl8/8.1 /usr/lib/tcltk/tcl8/8.2
      /usr/lib/tcltk/tcl8/8.3 /usr/lib/tcltk/tcl8/8.4
      /usr/lib/tcltk/tcl8/8.5 /usr/lib/tcltk/tcl8/8.6
      /usr/lib/tcl8/site-tcl /usr/lib/tcl8/8.0
      /usr/lib/tcl8/8.1 /usr/lib/tcl8/8.2
      /usr/lib/tcl8/8.3 /usr/lib/tcl8/8.4
      /usr/lib/tcl8/8.5 /usr/lib/tcl8/8.6
      /usr/share/tcltk/tcl8/site-tcl /usr/share/tcltk/tcl8/8.0
      /usr/share/tcltk/tcl8/8.1 /usr/share/tcltk/tcl8/8.2
      /usr/share/tcltk/tcl8/8.3 /usr/share/tcltk/tcl8/8.4
      /usr/share/tcltk/tcl8/8.5 /usr/share/tcltk/tcl8/8.6
      /usr/share/tcltk/tcl8.6/tcl8</code></pre>
    <br />
    <br />
    If I create a file called: <em>mymodtest-0.1.tm</em> with the following contents:<br />
    <pre>  <code>proc number {} {return 1}</code></pre>
    <br />
    I copy that file to the last location in the list above:<br />
    <pre>  <code>/usr/share/tcltk/tcl8.6/tcl8</code></pre>
    <br />
    Then I edit the file, replace the <code>1</code> with a <code>2</code>, and copy the file to the previous location in the list above:<br />
    <pre>  <code>/usr/share/tcltk/tcl8/8.6</code></pre>
    <br />
    Finally I edit the file again, replace the <code>2</code> with a <code>3</code>, and copy the file to the previous location in the list above:<br />
    <pre>  <code>/usr/share/tcltk/tcl8/8.5</code></pre>
    <br />
    When I run the following script:<br />
    <pre>  <code>package require mymodtest 
      number</code></pre>
    <br />
    I get a <code>1</code>; if I delete the file from the last location in the list, I get a <code>2</code>;  if I then delete the file from the previous location I get a <code>3</code>.
    
  5. foundin changed to: "8.6"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "4066e024a5415dc3e2c65c2860b9e3a9ee7c14b7"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "39. Package Manager"
  15. title changed to:
    package require searching module path in wrong order
    
  16. type changed to: "Bug"