Description: |
(text/x-fossil-wiki)
In the documentation for <code>next</code>, in the first example <code>oo::define</code> is called to configure the <code>obj</code> object: this should be <code>oo::objdefine</code>. Similarly in the second example, the <code>demo</code> object is configured using <code>oo::define</code> instead of <code>oo::objdefine</code>.
Corrected code:
<verbatim>
oo::objdefine obj method example args {
puts "per-object method, args = $args"
next x {*}$args y
next
}
</verbatim>
and
<verbatim>
oo::objdefine demo {
mixin cache
method compute {a b c} {
after 3000 ;# Simulate deep thought
return [expr {$a + $b * $c}]
}
method compute2 {a b c} {
after 3000 ;# Simulate deep thought
return [expr {$a * $b + $c}]
}
}
</verbatim>
|