Tcl Source Code

View Ticket
Login
Ticket UUID: 655176
Title: Reference implementation for TIP 123
Type: Patch Version: None
Submitter: arjenmarkus Created on: 2002-12-17 13:21:36
Subsystem: None Assigned To: dkf
Priority: 9 Immediate Severity:
Status: Closed Last Modified: 2009-05-24 22:25:52
Resolution: None Closed By: dkf
    Closed on: 2003-09-13 00:06:29
Description:
TIP 123 provides a new operator for [expr], **, that
does exponentiation.
The tar-file contains a reference implementation based
on Tcl 8.4.1
User Comments: dgp added on 2009-05-24 22:25:52:

data_type - 310894

dgp added on 2009-05-24 22:19:09:

IP - Comment Removed: 173.66.202.182

dkf added on 2009-01-24 22:39:44:

allow_comments - 1



data_type - 210894

dkf added on 2003-09-15 17:14:24:
Logged In: YES 
user_id=79902

I was convinced it was OK too, which is why it was an
unpleasant surprise when I hit problems when writing the
test suite!  :^/  (I suppose this can stand as testimony to
why TIP implementations require a test suite in the first
place; its not easy to write covering tests, but it catches
ever so many silly mistakes that it is ever so worth it.)

arjenmarkus added on 2003-09-15 13:46:14:
Logged In: YES 
user_id=400048

Oh my, I do apologise for this - I had convinced myself that
all was okay. I will have to look into this more closely, so
as to learn from this!

dkf added on 2003-09-13 07:06:30:

File Added - 61395: tcl_expon.patch

dkf added on 2003-09-13 07:06:29:
Logged In: YES 
user_id=79902

Applied, and thanks for developing this code.  However...

There was a whole bunch of problems with the reference
implementation, so I had to rework a lot of it when applying
to the core.

First off, the reference was full files not a patch.  That's
really hard to work with given that the bytecode engine does
tend to evolve fairly quickly internally (just by virtue of
being a large piece of code!)Secondly, there were no tests.
 If there had been, the many technical problems with the
patch would have shown up for you (it's behaviour was plain
wrong in a number of aspects!)
Thirdly, it inserted an instruction in the middle of the
bytecode list.  Don't do that.  I know it means you have to
do some hacking inside IllegalExprOperandType() but that's
better than breaking backward compatability for tbcload...
Fourthly, it had no documentation.  Writing docs isn't hard
even in nroff; you can just copy the existing docs (that's
what I do normally!)

I attach the patch that I used. I don't know how easily it
will apply to anything, but it does fix all the faults I
know about so far.

arjenmarkus added on 2002-12-17 20:23:59:

File Added - 37808: tcl_expon.tar.gz

Attachments: