File: needs.doc

package info (click to toggle)
hol-light 20230128-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 45,636 kB
  • sloc: ml: 688,681; cpp: 439; makefile: 302; lisp: 286; java: 279; sh: 251; yacc: 108; perl: 78; ansic: 57; sed: 39; python: 13
file content (34 lines) | stat: -rw-r--r-- 972 bytes parent folder | download | duplicates (7)
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
26
27
28
29
30
31
32
33
34
\DOC needs

\TYPE {needs : string -> unit}

\SYNOPSIS
Load a file if not already loaded.

\DESCRIBE
The given file is loaded from the path as for {loadt}, unless it has already
been loaded into the current session (by {loads}, {loadt} or {needs}) and has
apparently (based on an MD5 checksum) not changed since then.

\FAILURE
Fails if the file is not found or generates a failure on loading.

\EXAMPLE
If a proof relies on more number theory, you might start it with
{
  needs "Library/prime.ml";;
  needs "Library/pocklington.ml";;
}
If necessary, these files will be loaded as for {loadt}. However, if they have
already been loaded (e.g. if the current proof is a component of a larger proof
that has already used them), they will not be reloaded.

\USES
The {needs} function gives a simple form of dependency management. It is good
practice to start every file with a {needs} declaration for any library that it
depends on.

\SEEALSO
load_path, loads, loadt.

\ENDDOC