True, false and text
You will learn
How to declare a bool and a str, and what a test can compare them with.
A bool is true or false. A str is text in double quotes, and the text may hold characters that mean something elsewhere in t27, such as a semicolon or two slashes: inside quotes they are just text. A test compares a bool or a str with == and !=. One honest limit: the checker in this browser does not stop a str given to a u8 constant, so keep types and values matched yourself.
Try it
Change NAME in the lesson spec and fix the test so that it passes again.

The two non-number types of t27 in one table, with what a test can do with them. Lesson 6 of the t27 basics course.
specs/basics/06_true_false_and_text.t27
// SPDX-License-Identifier: Apache-2.0
; t27 basics, lesson 6: True, false and text.
; bool holds true or false; str holds text between double quotes.
module basics_06_true_false_and_text;
pub const READY : bool = true;
pub const DONE : bool = false;
pub const NAME : str = "trit";
pub const NOT_A_COMMENT : str = "; and // inside quotes are text";
test bools_and_text_compare {
assert READY == true;
assert READY != DONE;
assert NAME == "trit";
}
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.