# snit debugging

puts "Tcl version: [info patch]"
puts "snit version [package r snit]"

snit::type gFoo {
    component Other -inherit yes

    constructor args {
	install Other using gBar $self.other
	$self configurelist $args
    }

    destructor {
	catch {$self.other destroy}
    }

    method {is foo} {} {
	return "This is gFoo 1!"
    }

    method isFoo {} {
	return "This is gFoo 2!"
    }
}

snit::type gBar {
    method {is bar} {} {
	return "This is gBar 1!"
    }

    method isBar {} {
	return "This is gBar 2!"
    }
}

set gf [gFoo .gf]

foreach m {{is foo} isFoo {is bar} isBar} {
    catch "$gf $m" msg
    puts "\[$gf $m\] := $msg"
}

$gf destroy
