On 02/22/2018 04:39 AM, Dipl. Ing. Sergey G. Brester via Tcl-Core wrote:
> One question I still have - should we really use completely new > bytecode-instruction for the insert,> doing almost the same as the string replace (INST_STR_REPLACE)?> Even if there is the common routine now, that used for both processes.> > I mean would be possibly my continuation of this branch better eligible > for the TIP?
I do like your approach better with a single instruction plus a
parameter argument, and I agree that continuing your branch is a good
way to bring that forward.
What we cannot do is incompatibly change the way bytecode instruction
177 (INST_STR_REPLACE) functions.
The new approach has to be created as a new instruction, which it
appears would be bytecode 190. At that point, all generated bytecode
would use only the new instruction, and the legacy instruction would
only exist to support bytecode brought into an interp via tbcload. This
is just like the instructions INST_LOR, INST_LAND, INST_CALL_FUNC1,
and probably several more already in legacy status.
On the trunk (Tcl 9.0a0), I see that instructions
INST_CALL_BUILTIN_FUNC1 (62) and INST_CALL_FUNC1 (63) have already been
removed -- I think in pursuit of TIP 495 "Remove Deprecated API". It
looks to me like there's more that can go, and unless there's objection
I think we should take TIP 495 as permission to do so.
So, I think on the sebres-string-insert-cr1 branch, we shift the
bytecode work to instruction 190, restore/revise the legacy instruction
177, and then make the other revisions to Tcl_ReplaceObj() ->
Tcl_StringReplace(). I think the result will be what a TIP 475
implementation should look like.
We can address the further improvements that stricter encoding will
make possible whenever we commit to that change as a separate question.
That will be easier to do with the implementation all contained in a
single routine.
-- | Don Porter Applied and Computational Mathematics Division |
| dona...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Tcl-Core mailing list
Tcl-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcl-core