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-05-14 06:44:53 and 2024-05-25 16:36:56

︙
121
122
123
124
125
126
127







128
129
130
131
132
133
134
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141







+
+
+
+
+
+
+








Q - has the behavior of `global` changed within namespaces?

The behavior of the `global` command within namespaces has not changed. The command has no effect when used outside the context of a proc or apply body. Using `global` inside a namespace eval block does nothing. Variable names passed to the global command are still resolved relative to the global namespace, as they have always been. So, using `global ns::var` (inside a proc or apply body) will create a local variable var that is linked to the namespace variable ::ns::var.

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

## Changes in parsing of variable names

When parsing braced variable references of the form `%{..}`, in 8.6 the first `}` always terminated the variable name. In 9.0, any nested `{` are counted and the variable name is terminated by the `}` matching the opening `{`.
A similar change also applies to parsing of array element names enclosed in `()`.

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

## Arguments to `load` are Unicode-aware and case sensitive

In Tcl 8, the second argument to the `load` command which specifies
the initialization function was case-insensitive. This is inconsistent
with the rules for package names which are case-sensitive. In Tcl 9,
initialization function names are now case sensitive. For example,
if the initialization function was called `Sample_Init`, either of the
︙