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 2023-11-06 16:37:58 and 2023-11-06 17:09:29

︙
180
181
182
183
184
185
186




















187


188


189
190







180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206

207
208
209
210
211


212
213
214
215
216
217
218







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+

+
+
-
-
+
+
+
+
+
+
+

The long deprecated variable `tcl_precision` that controlled conversion
of floating point numbers to strings has been removed. Use the `format`
command instead to control number of digits generated.

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

## Zipfs file system

Tcl 9 introduces the ability to embed scripts as a zip archive
bound to an executable or shared library. The default build is configured to make
use of this capability and binds the Tcl initialization and support scripts
into the shared library (for shared builds) or executable (for static builds).
From a scripting perspective, this has several ramifications in terms of
compatibility:

* There is new file system type `zipfs` with its own rules for file names
and directories. In particular, names are case sensitive even on Windows. Other
differences include disallowing of creation of new files and directories. Existing
files may be modified but the changes are not persisted to disk and are lost
after dismounting the archive. See the `zipfs` manpage for details.

* The feature has the side effect of introducing the concept of volumes
on Unix (Windows programmers already had to deal with drives as volumes).

```
        % file volumes
## zipfs related
        //zipfs:/ /
```

* One implication of the above is that searches for files can no longer simply begin
at `/` but need to iterate across all volumes.
TBD - build modes, auto_path changes, cannot use auto_path to install
packages etc.

* The paths within `auto_path` *may* point to locations within the `zipfs` volume.
These are not writable so any installers that copy files into that location will fail.
Installers should check for writable locations in any case but this change will
result in errors in installers that write to directories in `auto_path` without
these checks.