File: runtime.inc

package info (click to toggle)
critcl 3.3.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,680 kB
  • sloc: ansic: 41,058; tcl: 12,090; sh: 7,230; pascal: 3,456; asm: 3,058; ada: 1,681; cpp: 1,001; cs: 879; makefile: 333; perl: 104; xml: 95; f90: 10
file content (25 lines) | stat: -rw-r--r-- 1,131 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

The default behaviour of critcl, the package is to defer the
compilation, linking, and loading of any C code as much as possible,
given that this is an expensive operation, mainly in the time
required.

In other words, the C code embedded into a [file .critcl] file is
built only when the first C command or procedure it provides is
invoked.

This part of the system uses standard functionality built into the Tcl
core, i.e. the [var auto_index] variable to map from commands to
scripts providing them and the [cmd unknown] command using this
information when the command is needed.

[para] A [emph limitation] of this behaviour is that it is not
possible to just use [cmd {info commands}] check for the existence of
a critcl defined command. It is also necessary to search in the
[var auto_index] array, in case it has not been build yet.

[para] This behaviour can be changed by using the control command
[cmd critcl::load]. When invoked, the building, including loading of
the result, is forced. After this command has been invoked for a
[file .critcl] file further definition of C code in this file is not
allowed any longer.