|
2015-08-18
| ||
| 12:50 | • Ticket [d06b029d9d] documentation: oo::define instead of oo::objdefine in exampl... artifact: 4c2c4f937a user: dkf | |
| 12:48 | • Closed ticket [d06b029d9d]. artifact: 9acf1c66d8 user: dkf | |
| 12:47 | [d06b029d9d] next(n) documentation examples correction, from Peter Lewerin. check-in: 831d83dd4e user: dkf tags: trunk | |
|
2015-07-27
| ||
| 14:17 | • New ticket [d06b029d9d] documentation: oo::define instead of oo::objdefine in ex... artifact: 4f0e1a8d58 user: peterlewerin | |
documentation: oo::define instead of oo::objdefine in example for next
Closed / Fixedd06b029d9d0fc9e68288f1a4f5b8635016fdb905Created 11 years agoUpdated 11 years ago
Descriptionwiki2015-07-27 14:17:17
In the documentation for
next, in the first example oo::define is called to configure the obj object: this should be oo::objdefine. Similarly in the second example, the demo object is configured using oo::define instead of oo::objdefine.
Corrected code:
oo::objdefine obj method example args {
puts "per-object method, args = $args"
next x {*}$args y
next
}
and
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}]
}
}
Referenced by1
831d83dd4e[d06b029d9d] next(n) documentation examples correction, from Peter Lewerin. check-in2015-08-18 12:47:01
dkfwiki2015-08-18 12:48:12
Silly mistake on my part. Might date from when there was no separate oo::objdefine command and oo::define would just magically "do the right thing".
dkf Ticket [d06b029d9d]: 4 changes
[History diff]2015-08-18 12:50:59
Log in (anonymous is fine) to add a comment.