Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1854 [interp alias] endless loop

obsolete: 8.3.4
closed-duplicate
Don Porter
5
2002-04-22
2002-04-22
Anonymous
No

OS platform and version: Windows 2000

Problem behavior:
With [interp alias] one can override built-in or
otherwise defined commands, also in the current
interp. But after deleting an alias, neither is the
original name visible again, nor an error raised for
unknown command; instead, an endless loop is reported
that the coder does not feel guilty of. (Richard
Suchenwirth)

Expected behavior:
I'm not sure which from reading man interp, but I
would expect one of
(1) original command visible again (preferrably); or
(2) "unknown command set"

Concise code sample:
% interp alias {} set {} puts stdout
set
% interp alias {} set
puts stdout
% set 5
5
% interp alias {} set {}
% interp alias {} set
% set i 5
too many nested calls to Tcl_EvalObj (infinite loop?)

Discussion

  • Logged In: YES
    user_id=79902

    This destroys the [set] command, and that blows up [unknown]
    unsurprisingly. Aliases are commands...

    IMHO this comes under the heading of "Doctor, it hurts when
    I shove a fork in my eye!" "Stop shoving forks in your eye."

     
  • Don Porter
    Don Porter
    2002-04-22

    • labels: 105661 --> 38. Init - Library - Autoload
    • assigned_to: hobbs --> dgp
    • status: open --> closed-duplicate
     
  • Don Porter
    Don Porter
    2002-04-22

    Logged In: YES
    user_id=80530

    This is a duplicate of Bug 217997.

    The default [unknown] expect some built-in Tcl
    commands to exist and have their original definitions.
    When that is not true, very strange things can happen.

    To some extent, this problem could be reduced by
    putting Tcl's built-in commands into the ::tcl
    namespace, but you can't make it go away completely,
    and still have Tcl be Tcl.