Skip to content
Tcl Source Code Changes To Migrating scripts to Tcl 9
Login

Changes To Migrating scripts to Tcl 9

Changes to "Migrating scripts to Tcl 9" between 2024-08-15 17:51:10 and 2025-02-19 09:38:17

1
2

3
4
5
6
7
8
9


1
2
3
4
5
6
7
8
-
-
+







Work in progress...
Currently focused on incompatibilities. Possibly hints on improving
This text focuses on incompatibilities. Possibly hints on improving
scripts making use of new facilities could be added at some point.

The [migration tool](https://github.com/apnadkarni/tcl9-migrate) may help
identify some of these issues. [Download](https://github.com/apnadkarni/tcl9-migrate/releases)

## Strict handling of ill-formed encoded data

︙
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
30
31
32
33
34
35
36


37
38
39
40
41
42
43







-
-







`encoding` command. Ill formed data or unsupported characters will result in an
error exception. The `-profile` option can be used in this case as well to
change this behavior.

For more on encoding profiles, refer to the `encoding` manpage.

See [TIP 657](https://core.tcl-lang.org/tips/doc/trunk/tip/657.md).



## Tilde substitution

File path arguments in Tcl 8 would be subject to tilde substitution
where `~` and `~USER` prefixes in the path would be replaced with the
home directory of the current or named user respectively. Although
convenient for interactive use, this behavior lead to both security and
︙
361
362
363
364
365
366
367









368
369
370
371
372
373
374
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380







+
+
+
+
+
+
+
+
+







Scripts making use of these should be modified as below:

* Replace `trace variable` with `trace add variable`

* Replace `trace vdelete` with `trace remove variable`

* Replace `trace vinfo` with `trace info variable`

The argument *ops* of those commands changed from a string with flags to a list with keywords, as shown in the following example:
```
trace variable myvar wo mycmd
```
is replaced by:
```
trace add variable myvar {write unset} mycmd
```

See [TIP 673](https://core.tcl-lang.org/tips/doc/trunk/tip/673.md).

## Removal of `tcl_precision`

The long deprecated variable `tcl_precision` that controlled conversion
of floating point numbers to strings has been removed. Use the `format`
︙