pub or private
You will learn
What pub declares, and what the TypeScript backend writes with and without it.
pub in front of const, fn, struct or enum says other modules may use the name. Without pub the name is meant for the module itself. Today the compiler does not enforce this in the code it writes: gen-ts exports both the pub and the private constant of the lesson spec. Use pub to say what a module offers, and read the generated code before relying on privacy.
Try it
Open the ts tab of the lesson spec in the player and find both constants.

A pub and a private t27 constant side by side with the TypeScript the real compiler wrote for each. Lesson 16 of the t27 basics course.
specs/basics/16_pub_or_private.t27
// SPDX-License-Identifier: Apache-2.0
; t27 basics, lesson 16: pub or private.
; pub marks a name for other modules; without it the name is the module's own.
module basics_16_pub_or_private;
pub const OFFERED : u8 = 1;
const OWN : u8 = 2;
test both_names_exist_in_the_module {
assert OFFERED == 1;
assert OWN == 2;
}
All lessons
Module 1 · A spec file
What a .t27 file holds: a module line, prose lines and comments.
Module 2 · Values and types
Constants, the width of a whole number, and true, false and text.
Module 3 · Arrays, trits and expressions
Lists of values, the three values of a trit, and what operators compute.
Module 4 · Tests and functions
A test block, several small tests in one spec, and a function with typed inputs.
Module 5 · Inside a function
Names with let and var, choices with if and switch, and loops.
Module 6 · Visibility and your own types
What pub shares with other modules, and the structs and enums you declare.
Module 7 · Modules, rules and gen-ts
Reading another module, stating a rule that always holds, and a spec turned into TypeScript.
Module 8 · The compiler and tri
The backends t27c writes, the stages it reads a spec in, and the tri command.
Module 9 · Errors, a program, what next
Reading a compiler error, one small complete program, and the course to take next.