Skip to content

Commit ec70ad3

Browse files
Document stdlib module path.
1 parent be23322 commit ec70ad3

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

docs/SPECIFICATION.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,26 @@
11041104

11051105
Bundled extensions shipped with the interpreter MUST live under `ext/std/`. User-installed extensions MUST live under `ext/usr/`. Extension search paths MUST consult `ext/std/` immediately before `ext/usr/`, so bundled extensions are preferred over user-installed copies with the same name.
11061106

1107-
At present, the standard library is not defined by the specification, and any reasonable set of standard utilities is acceptable for a conforming implementation. Backwards-incompatible changes to the standard library MUST NOT increment the major version number of the specification, unless the incompatible change is altering a behaviour defined in this specification (NOTE: *At present* none of the stdlib is documented, and the stdlib should be considered unstable.).
1107+
At present, most of the standard library is not defined by the specification, and any reasonable set of standard utilities is acceptable for a conforming implementation. Backwards-incompatible changes to the standard library MUST NOT increment the major version number of the specification, unless the incompatible change is altering a behaviour defined in this specification.
1108+
1109+
### 10.1 Path
1110+
1111+
Path is a standard-library module that provides utilities for working with filesystem paths. It is implemented as a single module importable under the name `path`.
1112+
1113+
#### 10.1.1 API
1114+
1115+
- `STR NORMALIZE_PATH(STR path)` = Replace all backslashes in the path with forward slashes.
1116+
- `STR WINPATH(STR path)` = Replace all forward slashes in the path with backslashes.
1117+
- `STR BASEPATH(STR path)` = Return the directory part of the path, excluding the file name.
1118+
- `STR BASENAME(STR path)` = Return the file name part of the path, excluding the directory.
1119+
- `TNS SPLITEXT(STR path)` = Split the path into a tensor containing the base name and the extension.
1120+
- `STR EXTNAME(STR path)` = Return the file extension from the path, without the dot.
1121+
- `STR DELEXT(STR path)` = Return the path without the file extension.
1122+
- `STR TEMPFILE(STR prefix, STR suffix)` = Modify the path to originate in the system's temporary directory.
1123+
- `STR interpreter` = The path to the Prefix interpreter executable.
1124+
- `STR interpreter_dir` = The directory containing the Prefix interpreter executable.
1125+
- `STR script` = The path to the currently executing script.
1126+
- `STR script_dir` = The directory containing the currently executing script.
11081127

11091128
</script>
11101129

0 commit comments

Comments
 (0)