Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unexpected result from [slave alias srcCmd {}]

0 views
Skip to first unread message

Erik Leunissen

unread,
May 30, 2005, 12:29:54 PM5/30/05
to
L.S.

I'm exercising aliases between master and slave interps. The following
gave an unexpected result, or I misunderstood something.

The unexpected part is that [slave alias srcCmd {}] should delete a
previously defined alias. What I find is that it deletes the command
itself in the slave interpreter. See below for a reproducible script.

Did I misunderstand the meaning of an alias, or is this a bug?


Greetings,

Erik Leunissen
==============


% interp create slave
slave
% proc putsFromMaster {txt} {
puts "Master: $txt"
}
% slave alias puts putsFromMaster
puts
% slave eval puts foo
Master: foo
% puts [slave eval info commands p*]
pwd pid proc package puts
% slave alias puts {}
% slave eval puts foo
invalid command name "puts"
% puts [slave eval info commands p*]
pwd pid proc package

--
leunissen@ nl | Merge the left part of these two lines into one,
e. hccnet. | respecting a character's position in a line.

Erik Leunissen

unread,
May 30, 2005, 12:35:56 PM5/30/05
to
P.S.

I've been using Tcl.8.4.9

Erik

Andreas Leitgeb

unread,
May 31, 2005, 5:04:34 AM5/31/05
to
Erik Leunissen <lo...@the.footer.invalid> wrote:
> The unexpected part is that [slave alias srcCmd {}] should delete a
> previously defined alias. What I find is that it deletes the command
> itself in the slave interpreter. See below for a reproducible script.
> Did I misunderstand the meaning of an alias, or is this a bug?

I think the original command in the slave was deleted during
its "replacement" by the alias, not during deletion of the alias.

Erik Leunissen

unread,
May 31, 2005, 9:02:03 AM5/31/05
to
Andreas Leitgeb wrote:
>
> I think the original command in the slave was deleted during
> its "replacement" by the alias, not during deletion of the alias.
>

... and you are right.

Thanks,

Erik

0 new messages