Tcl Source Code

View Ticket
Login
Ticket UUID: 1587618
Title: important use of [info level 0] broken
Type: Bug Created on: 2006-10-31 01:05:54
Submitter: msofer Assigned to: dkf
Subsystem: 45. Parsing and Eval Severity:
Priority: 9 Immediate Last modified: 2006-10-31 20:48:02
Status: Closed Closed by: dkf
Resolution: Fixed Closed on: 2006-10-31 13:48:02
Version: obsolete: 8.5a6
Description:
HEAD breaks [info level 0]'s utility to find out the
number of arguments of a call, if the call is performed
via a curry (ensemble, apply or interp alias).

This breaks a very common idiom (used throughout in
tcllib), for instance:

proc ::struct::matrix::MatrixProc {name {cmd ""} args} {
    # Do minimal args checks here
    if { [llength [info level 0]] == 2 } {
    ...

[info level 0] should revert to its original behaviour
(true objv of the call).
User Comments:
msofer added on 2006-10-31 17:28:05:
Logged In: YES 
user_id=148712

The usage of [info level] in error stack traces, and to
create error messages as eg in [clock], led to [FR 1577492 ]
"let [info level] know ensemble rewrites" and this modification.

ISTM that breaking a common idiom that has no simple
workaround is a relatively severe bug, and nicer error
messages more like a WIBNI.

dkf added on 2006-10-31 20:48:01:
Logged In: YES 
user_id=79902

Fixed in HEAD. We could do with some kind of scheme that
allows procedures to find out what they were called as
before rewrites, but [info level 0] can't be it. :-\