Tcl Source Code

View Ticket
Login
Ticket UUID: 1577492
Title: reflect ensemble rewrites on error messages
Type: RFE Version: None
Submitter: msofer Created on: 2006-10-15 03:02:05
Subsystem: 17. Commands I-L Assigned To: msofer
Priority: 8 Severity:
Status: Open Last Modified: 2007-09-09 06:08:40
Resolution: None Closed By: msofer
    Closed on: 2006-10-24 23:13:14
Description:
Attached a patch that, while not touching [info level]
itself, makes it aware of rewrites: the (objc,objv)
fields in each CallFrame are not rewritten during
ensemble calls. 

If the patch in [Bug 1574835] is accepted, it should be
modified accordingly so that [interp alias] benefits
from this too.
User Comments: msofer added on 2007-09-09 06:08:40:

data_type - 360894

msofer added on 2006-10-31 17:29:20:
Logged In: YES 
user_id=148712

This has led to breaking a relatively common idiom, used a
lot in tcclib's struct an in Tkcon ([Bug 1587618 ]
"important use of [info level 0] broken").

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

Reverting the commit and reopening this FR with a new title.

msofer added on 2006-10-25 06:13:14:
Logged In: YES 
user_id=148712

Added info-9.11-12

msofer added on 2006-10-24 07:36:40:
Logged In: YES 
user_id=148712

Add tests! Also specific for ensembles and aliases.

msofer added on 2006-10-24 05:50:43:
Logged In: YES 
user_id=148712

The commit also fixed clock::format and clock::scan wrong #
args messages, and their tests.

msofer added on 2006-10-17 08:08:50:
Logged In: YES 
user_id=148712

Interesting side effect of this on toy oo systems based on
ensembles (neo, eos): there is now no need to
rewrite/reorder the cmd line. The name of the "object" (the
calling ensemble) can be retrieved with
   set self [lindex [info level 0] 0]

msofer added on 2006-10-16 01:54:23:
Logged In: YES 
user_id=148712

This has essentially the same behaviour as 1400572, which is
already in HEAD. If we choose to go back to 8.4 behaviour,
with [namespace inscope] having an empty [info level], that
can be done easily here too: the caller of Tcl_PushCallFrame
can rewrite those fields afterwards anyway - they are just
being initialised differently than they were before.

IOW, 1400572 breakage would be fixed in this patch by just
adding 'iPtr->objc=0;' in [namespace inscope]'s code, should
we choose to allow it to have an empty [info level].

dgp added on 2006-10-16 01:23:01:
Logged In: YES 
user_id=80530


I'm pretty sure the
1400572 fix caused no
Itcl test suite failures
either.  Still caused
enough trouble with existing
Itcl code that it had to go.

msofer added on 2006-10-15 21:21:21:
Logged In: YES 
user_id=148712

Just checked: this patch has no effect on the itcl
testsuite. It causes the same 4 testsuite errors and a
seggie as HEAD.

msofer added on 2006-10-15 19:26:41:
Logged In: YES 
user_id=148712

Remark that this patch does not really touch (objc, objv)
any more than HEAD. Quite the contrary: it avoids touching
it for ensemble calls. The fix for itcl or any other weirdo
wanting to store things in there itself is to store them
*after* pushing the stack frame. Note also: as the core uses
TclPushStackFrame and itcl Tcl_PushCallFrame on frames it
allocates itself (bwerk!), it is easy to make this patch
only touch (objc, objv) on frames pushed on the stack: itcl
should never see it. I think ... except if itcl wants to
determine what non-itcl call frames do too?

dgp added on 2006-10-15 10:24:31:
Logged In: YES 
user_id=80530


Be careful here.  As the
attempt to fix 1400572
demonstrated, Itcl is 
sensitive in mysterious
ways to what gets stored
in those objc, objv fields.
May even be storing things
there itself?

msofer added on 2006-10-15 10:02:05:

File Added - 198222: infolevel.patch

Attachments: