Re: [tcltk-perl] Why is Tcl a subclass of Tck::Tk?
Brought to you by:
hobbs
|
From: Gisle A. <gi...@Ac...> - 2004-04-14 10:13:01
|
"Konovalov, Vadim" <vko...@sp...> writes:
> > In Tcl.pm I see this code:
> >
> > unless (defined $Tcl::Tk::VERSION) {
> > package Tcl::Tk; # define empty package
> > }
> > use vars qw(@ISA);
> > @ISA = qw(DynaLoader Tcl::Tk);
>
> I can agree this is not very correct way to do things...
>
> >
> > Why is Tcl as subclass of Tck::Tk insted of the other way around? The
> > other way seems more logical.
>
> Could you please explain your way of doing things?
I would expect:
$tcl = Tcl->new;
to give me an interpreter that only can do the plain Tcl stuff,
i.e. what tclsh can do.
I would expect:
$tcltk = Tcl::Tk->new
to be a subclass of Tcl that can do plain Tcl stuff as well as all the
Tk stuff, ie. what wish can do.
I don't expect my $tcl to suddenly grow more capable or different just
becase I happened to load the Tcl::Tk module in the same process
later. Perhaps I just misunderstand what tcl actually looks like
underneath. I have not used actually tcl in 15 years, so my memory of
what it is is rusty.
> The point here is that Tcl::Tk interpreter actually *is* plain Tcl
> interpreter and may be they be'll better joined intoone single module.
I think the separation is ok.
> OTOH having two different modules -- one is for low level communicating, and
> other is for Tk part (GUI and perlTk compatibility) is very handy for me:
> developing of Tcl::Tk could be done more easily and independent.
Agree.
--Gisle
|