Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2016-07-02
19:03 • Closed ticket [776614ffff]: Incremental evaluation of scripts plus 5 other c... artifact: 1237787d2e user: dgp
2003-07-24
17:02 • Ticket [776614ffff]: 5 changes artifact: 8b431754a5 user: dkf
11:15 • Open ticket [776614ffff]. artifact: 418fe7ce60 user: ysutjandra
09:43 • Pending ticket [776614ffff]. artifact: 11e256bf2d user: dgp
00:25 • New ticket [776614ffff]. artifact: de5165d09a user: ysutjandra

Incremental evaluation of scripts

Closed / Rejected776614ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 10 years ago
Descriptionplain2003-07-24 00:25:07
Hi,

Currently, when I source a file, TCL creates a buffer 
whose size is equivalent to the size of the file.  Then 
evaluate the buffer altogether.

I'm asking for a utility whereby I can specify the size of 
buffer I want Tcl_SourceObjCmd to work with.  And as 
much as possible, TCL does not grow this buffer size, 
unless if needed.  

A possible example where growing the buffer size is 
needed is if you encounter a flow-control commands 
such as while, for, etc, or any other commands that 
require a open-curly-brace and close-curly-brace.

This kind of feature will be very useful when most of the 
time you source a script that is really-really-really huge.

A good testcase maybe a 100,000-line script where 
each line is doing the same thing.

   for { set i 0 } { $i < 10 } { incr i } { }
   for { set i 0 } { $i < 10 } { incr i } { }
   for { set i 0 } { $i < 10 } { incr i } { }
   ...

-- Yohan
dgpplain2003-07-24 09:43:00
Logged In: YES 
user_id=80530


Tcl provides the commands
[read], [eval], [info complete],
and [info script $filename], so
it's very simple to construct 
your own [proc] to do what you
want.

Given that, I see little need to
augment [source] in the manner
you suggest.
ysutjandraplain2003-07-24 11:15:42
Logged In: YES 
user_id=799156

I've already tried using the Tcl commands that you 
suggested.  But the runtime turned out to be very slow on a 
huge script.

-- Yohan
dkfplain2003-07-24 17:02:43
Logged In: YES 
user_id=79902

There's no particular reason why we couldn't redesign
Tcl_FSEvalFile() to work incrementally once the file size
has gone over some threshold.  It wouldn't even be an
externally visible alteration AIUI (unless the channel used
to read the file is visible during processing...  Hmm...)
dgp Closed ticket [776614ffff]. [History diff]2016-07-02 19:03:11
Log in (anonymous is fine) to add a comment.