hd-lang

Tour · 19 of 25

A file shares only what it marks pub, so its helpers stay its own business

Each file is a module, named by its path: src/pricing.hd is pricing. A declaration is private to its file unless it says pub, and another file sees a public name only after it asks for it with use. So the shipping fee rule in fee can change, or vanish, without breaking any other file: no other file can call it. The use line at the top of a file lists everything it takes from elsewhere, and the pub items of a file are its whole interface. Open the pricing.hd tab to see both sides.

Run: Ctrl+Enter · Pages: Alt+← Alt+→