rl_lang/docs/entries/concepts/imports/
mod.rs1use crate::docs::entry::{ConceptCategory, ConceptEntry, DescriptionEntry, DescriptionKind};
2
3pub static IMPORTS: ConceptEntry = ConceptEntry {
4 name: "imports",
5 descriptions: &[
6 DescriptionEntry {
7 description: "import a single stdlib function with `get std::<module>::<function>`",
8 examples: &["get std::math::sqrt\n\nsqrt(9.0) // 3.0"],
9 kind: DescriptionKind::Explanation,
10 title: None,
11 expected_output: &[],
12 },
13 DescriptionEntry {
14 description: "import multiple stdlib functions with `get <fn1>, <fn2> from std::<module>`",
15 examples: &["get sin, cos from std::math\n\nsin(0.0) // 0.0\ncos(0.0) // 1.0"],
16 kind: DescriptionKind::Explanation,
17 title: None,
18 expected_output: &[],
19 },
20 DescriptionEntry {
21 description: "import a local file with `get <filename>` and loads `<filename>.rl` from the same directory",
22 examples: &["get utils\n// loads utils.rl"],
23 kind: DescriptionKind::Explanation,
24 title: None,
25 expected_output: &[],
26 },
27 DescriptionEntry {
28 description: "import named items from a local file with `get <fn> from <path>::<file>`",
29 examples: &["get add from math::utils\n// imports add from math/utils.rl"],
30 kind: DescriptionKind::Explanation,
31 title: None,
32 expected_output: &[],
33 },
34 ],
35 summary: "",
36 category: ConceptCategory::Syntax,
37 prerequisites: &[],
38 pitfalls: &[],
39 related: &[],
40 related_stdlib: &[],
41 since: None,
42};