Tcl Source Code

View Ticket
Ticket UUID: 2c509f629112e03fd8af850b109c6fbd37cd6e70
Title: documentation: wrong command in example for my
Type: Bug Version: 8.6.4
Submitter: peterlewerin Created on: 2015-07-27 14:07:10
Subsystem: 35. TclOO Package Assigned To: dkf
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2015-08-18 12:50:32
Resolution: Fixed Closed By: dkf
    Closed on: 2015-08-18 12:50:32
Description: (text/x-fossil-wiki)
In the documentation for <code>my</code>, in the example the <code>count</code> method calls the command <code>print</code>: this should probably be <code>puts</code>.

Corrected code:

oo::class create c {
    method count {} {
        my variable counter
        puts [incr counter]