Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: db24ab58fa8708c8638ce7d636224cdc4973acdc
Ticket: 2500398fffffffffffffffffffffffffffffffff
Slot management system for TclOO
User & Date: coldstore on 2009-01-12 02:26:05
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    It seems that [variable] within class declaration doesn't 'accumulate' variable names, so there can only be a single [variable] in the declaration.
    
    I would expect the following to produce "moop v3 1" instead of erroring.
    
    
    package require TclOO
    namespace import oo::*
    
    class create Vartest {
        variable v3
        variable v1 v2
    
        method moop {v} {
    puts stderr "moop $v [set $v]"
        }
        method woo {} {
    my moop v1
    my moop v2
    my moop v3
        }
        constructor {} {
    set v1 1
    set v2 1
    set v3 1
        }
    }
    
    Vartest create test
    test woo
    
    PRODUCES:
    
    tclsh8.6 tcloo.tcl
    moop v1 1
    moop v2 1
    can't read "v3": no such variable
        while executing
    "set $v"
        (class "::Vartest" method "moop" line 2)
        invoked from within
    "my moop v3"
        (class "::Vartest" method "woo" line 4)
        invoked from within
    "test woo"
        (file "tcloo.tcl" line 24)
    
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "coldstore"
  10. subsystem changed to: "35. TclOO Package"
  11. title changed to: "unexpected [variable] behaviour"
  12. type changed to: "RFE"