Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2018-11-19
18:18 • Closed ticket [ee7f99d84e]: unable to execute tcl/library/clock.tcl file plu... artifact: 9d39f74a2e user: sebres
17:37 • New ticket [ee7f99d84e]. artifact: 185b57a806 user: anonymous29

unable to execute tcl/library/clock.tcl file

Closed / Invalidee7f99d84e8b324ff34d583f50d02f5c7a877aa4Created 8 years agoUpdated 8 years ago
Descriptionplain2018-11-19 17:37:37
Hi,

I am upgrading tcl from tcl8.4.13 to tcl8.6.8.
there is proc which translate  translate TCL code for use.
and then translated code used by perl script. like below

proc source called for (-encoding utf-8 tcl8.6.8/library/clock.tcl).
 Will translate TCL code for use

translate_then_source:  calling
> translate_tcl.pl {-encoding utf-8 tcl8.6.8/library/clock.tcl}

Am i not using correct encoding method or any other issue ??

Thanks,
Arvind
sebreswiki2018-11-19 18:18:04

Command "source" accepts options now, thus can be used with 1 and 3 arguments:

source fileName
source -encoding encodingName fileName
Your perl script seems to parse source-command incorrectly if found "source" command that has 3 args, so it does not wrap it correctly.

BTW. proper tcl "wrapper-template" for source (that simply ignore encoding param) looks like:

proc ::source {args} {
  set fn [lindex $args end]
  puts "proc source called for ($fn)"
}

Additionally note, that if your script evaluates Tcl-scripts and somewhere within "clock" ensemble is used, it may auto-load library/clock.tcl using "source" command (lazy loading on demand). You can avoid it also, if you call "clock format 0" before you create your own resp. overwrite it with own wrapper for the "source" command.

Thus closed as 3rd party issue.

Log in (anonymous is fine) to add a comment.