All pastes #90353 Raw Edit

delinka

public text v1 · immutable
#90353 ·published 2006-07-17 16:25 UTC
rendered paste body
proc add_human { name age } {
    global allHumans
    set human(name) $name
    set human(age) $age

    set allHumans([gen_id $human]) $human
}

proc list_humans {
    global allHumans
    foreach h in [array names $allHumans] {
        set human $allHumans($h)
        set name $human(name) ;# can't read "human(name)": variable isn't array
    }
}

proc gen_id { human } {
#do something useful and return an id
}