Posted to tcl by emiliano at Mon Jun 01 19:06:28 GMT 2020view raw
- oo::class create Foo {
- method bar {} {
- puts class:[info level]
- return
- }
- }
- Foo create foo
- oo::objdefine foo {
- method bar {} {
- puts object:[info level]
- next
- puts here
- }
- }
- % foo bar
- object:1
- class:1
- here
- % oo::define Foo {
- method bar {} {
- puts class:[info level]
- return -level 2
- }
- }
- % foo bar
- object:1
- class:1