Skip to content
Tcl Source Code History Of Ticket 2164282
Login

History Of Ticket 2164282

Artifacts Associated With Ticket 2164282

  1. Ticket change [9fb397ae2f] (rid 96686) by tallniel on 2008-10-13 18:51:28:

    1. assignee initialized to: "davidw"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Thanks to John W. Hamill for reporting these bugs:
      
      
      I found an error that I though you might like to know about.
      
      on URL 
      http://www.tcl.tk/man/tcl8.5/tutorial/Tcl20.html
      
      At the bottom is this example.
      ---
      set sample "Where there is a will, There is a way."
      
      #
      # Match the first substring with lowercase letters only
      #
      set result [regexp {[a-z]+} $sample match]
      puts "Result: $result match: $match"
      
      #
      # Match the first two words, the first one allows uppercase
      set result [regexp {([A-Za-z]+) +([a-z]+)} $sample match sub1 sub2 ]
      puts "Result: $result Match: $match 1: $sub1 2: $sub2"
      
      #
      # Replace a word
      #
      regsub "way" $sample "lawsuit" sample2
      puts "New: $sample2"
      
      #
      # Use the -all option to count the number of "words"
      #
      puts "Number of words: [regexp -all {[^ ]} $sample]"
      ---
      
      The last line should be:
      
      puts "Number of chars not equal to space: [regexp -all {[^ ]}
      $sample]"
      
      since it counts how many none space characters. (30 instead of 9.)
      If it was suppose to count words then it needs to be fixed.
      
      ----------------
      http://www.tcl.tk/man/tcl8.5/tutorial/Tcl18.html
      
      around the 6th paragraph.
      
      string wordstart string index 
      Returns the index of the character >>>>>>>>just before<<<<<<<<<<< the first
      one in the word which contains the index'th character of string. A word is
      any contiguous set of letters, numbers or underscore characters, or a single
      other character. 
      
      should be:
      
      string wordstart string index 
      Returns the index of the character >>>>>>>>at<<<<<<<<<<<<<<<<<<<< the first
      one in the word which contains the index'th character of string. A word is
      any contiguous set of letters, numbers or underscore characters, or a single
      other character. 
      
      or it could be worded better then what I did.
      ----------------
      http://www.tcl.tk/man/tcl8.5/tutorial/Tcl10.html
      
      Example at the end:
      
      ...
      puts "Start"
      set i 0
      while {$i < 10} {
          puts "I inside first loop: $i"              <<<<<<<<<<<<<<<<<<
          incr i
          puts "I after incr: $i"
      }
      ...
      Should be:
      
      ...
      puts "Start"
      set i 0
      while {$i < 10} {
          puts "I inside third loop: $i"             <<<<<<<<<<<<<<<<<<<
          incr i
          puts "I after incr: $i"
      }
      ...
      
      ----------------
      http://www.tcl.tk/man/tcl8.5/tutorial/Tcl22.html
      
      The example at the bottom
      refers to arrays a(0) ... a(4)
      but they are never create before being referenced.
      
      Maybe some of the code in
      http://www.tcl.tk/man/tcl8.5/tutorial/Tcl6.html
      should be added to Tcl22.html
      to define these arrays.
      Tcl16.html doesn't have a(1)
      Maybe a(0) needs to be a(1).
      
      ----------------
      C:\__jh\ftp\tkTcl\www_tcl_tk\tutorial\29Information about Files - file,
      glob.mht
      
      The example at the end
      
      ...
      set dirs [glob -nocomplain -type d *]
      if { $dirs != {} } {
          puts "Directories:                    <<<<< Missing end quote "
      ...
      set files [glob -nocomplain -type f *]
      if { $files != {} } {
          puts "Files:                          <<<<< Missing end quote "
      ...
      ----------------
      C:\__jh\ftp\tkTcl\www_tcl_tk\tutorial\31State of the interpreter - info.mht
      
      In the Example at the bottom of the page
      
      ...
      proc factorial {val} {
          puts "Current level: [info level] - val: $val"
          set lvl [info level]
          if {$lvl == $val} {
              return $val
          }
          return [expr {($val-$lvl) * [factorial $val]]}]  <<<<<<< Too many "]"
      square brackets
      }
      ...
      #
      # Use [info script] to determine where the other files of interest
      # reside
      #
      set sysdir [file root [info script]]            <<<<<<<<<<<<<<< root didn't
      work. It game me the first part of
                                                                      of my
      "my.tcl" program name "my"
      source [file join $sysdir "utils.tcl"]
      
      should be:
      
      ...
          return [expr {($val-$lvl) * [factorial $val]}]
      ...
      set sysdir [file dirname [info script]]         <<<<<<<<<<<<<< I needed to
      use dirname to make this work
      ...                                                            It gives me
      "." for current directory.
                                                                     Now the join
      statement create ./utils.tcl
                                                                     and I created
      this program and it runs
      
    4. foundin initialized to: "obsolete: 8.6a3"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "tallniel"
    10. subsystem initialized to: "75. Tutorial"
    11. title initialized to: "Variety of bugs in tutorial code examples"
    12. type initialized to: "Bug"
  2. Ticket change [3c9ebba0ab] (rid 120942) by tallniel on 2008-10-14 01:51:51:

    1. assignee changed to: "tallniel"
  3. Ticket change [44ddce80db] (rid 116779) by tallniel on 2008-10-14 02:27:13:

    1. closedate changed to: "2008-10-13T19:27:13"
    2. closer changed to: "tallniel"
    3. icomment:
      All errors should now be fixed in CVS HEAD.
      
      
    4. login: "tallniel"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "tallniel"