Skip to main content

rl_lang/docs/entries/tutorial/t2/
p_a1.rs

1use crate::docs::entry::{ConceptCategory, ConceptEntry, DescriptionEntry, DescriptionKind};
2
3pub static ADV_INTRO: ConceptEntry = ConceptEntry {
4    name: "1. what we are building",
5    summary: "what we are building",
6    category: ConceptCategory::Tooling,
7    prerequisites: &[],
8    descriptions: &[
9        DescriptionEntry {
10            kind: DescriptionKind::Explanation,
11            title: None,
12            description: "in the beginner tutorial you built a self-contained game. everything lived in one file and nothing persisted between runs. real programs are different - they are split across multiple files, they save and load data, and they are built from reusable pieces.\n\nthis tutorial builds two things:\n  part 1 - a CSV library in csv.rl that parses, queries, and writes CSV files\n  part 2 - a task manager CLI in main.rl that imports and uses that library\n\nby the end you will have a program you can actually use day to day",
13            examples: &[
14                "// what the finished program looks like\n// $ rl run main.rl\n// task manager ready. type 'help' for commands\n// > add buy groceries\n// added task 1: buy groceries\n// > add write tutorial\n// added task 2: write tutorial\n// > done 1\n// marked task 1 as done\n// > list\n// [1] [done]    2026-06-20  buy groceries\n// [2] [pending] 2026-06-20  write tutorial\n// > remove 1\n// removed task 1\n// > quit\n// goodbye",
15            ],
16            expected_output: &[],
17        },
18        DescriptionEntry {
19            kind: DescriptionKind::Explanation,
20            title: None,
21            description: "the CSV format we will use is simple: each row is one line, fields are separated by semicolons (not commas, to avoid conflicts with task text). the task file looks like this",
22            examples: &[
23                "// tasks.csv\n// id;status;created_at;text\n// 1;pending;1750000000;buy groceries\n// 2;done;1750000100;write tutorial\n// 3;pending;1750000200;fix bug in parser",
24            ],
25            expected_output: &[],
26        },
27        DescriptionEntry {
28            kind: DescriptionKind::Explanation,
29            title: None,
30            description: "we use semicolons instead of commas so task text can contain commas freely. no quoted field handling needed - keep it simple, keep it readable",
31            examples: &[
32                "// valid task text with our format:\n// buy milk, eggs, and bread   <- comma in text, fine because delimiter is ;\n\n// would break a comma-delimited CSV:\n// buy milk, eggs, and bread   <- parser would split this into 4 fields",
33            ],
34            expected_output: &[],
35        },
36    ],
37    pitfalls: &[],
38    related: &[],
39    related_stdlib: &[],
40    since: None,
41};