Patterns in structure
This chapter has 5 cells and writes 11 promises. In each of its four editions its cells were run in one fresh process on 2026-10-08 20:15: English, 5 cells ran, 11 promises kept; Français, 5 cells ran, 11 promises kept; العربية, 5 cells ran, 11 promises kept; Hausa, 5 cells ran, 11 promises kept. The four editions make the same promises, cell for cell. No edition stores any output.
The guard
The course's guard is course_narrated.ring(opens in a new tab): it runs every chapter in all four languages, compares the promises from one edition to the next, and has every exercise prove itself on its wrong and right answers. This page asked the same questions of the same objects, in one process inside the library, at commit 0e72e2e2c. To prove this chapter alone, from your copy of the repository:
cd libraries/stzlib/base/test/education # run course_narrated with the repository's runtime, for this chapter: # course_narrated patterns-in-structure
run on 2026-10-08 20:15 inside the library at commit 4a184e6f0, in 246.4 s for the whole book · The four editions of the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)
The reader stores no output, by the course's own law; this page is the record of a run, made for it.
The cells, run
Cell 1 · 1. The shape of a list
? Lx("[@N, @S]").Match([ 42, "hello" ])
#--> TRUE
? Lx("[@N, @S]").Match([ "hello", 42 ])
#--> FALSE1 0
ran: the promise is kept · in all four editions
This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)
Cell 2 · 2. How many of each
? Lx("[@N1-3, @S]").Match([ 1, 2, "end" ])
#--> TRUE
? Lx("[@N1-3, @S]").Match([ 4, 5, 6, 7, "extra" ])
#--> FALSE1 0
ran: the promise is kept · in all four editions
This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)
Cell 3 · 3. A shape inside a shape
? Lx("[@N, [@N2], @N]").Match([ 1, [ 2, 3 ], 4 ])
#--> TRUE1
ran: the promise is kept · in all four editions
This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)
Cell 4 · 4. The shape of a number
oNx = new stzNumbrex("{@Property(Prime)}")
? oNx.Match(17)
#--> TRUE
? oNx.Match(18)
#--> FALSE1 0
ran: the promise is kept · in all four editions
This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)
Cell 5 · 5. Multiples, and digit counts
oNx5 = new stzNumbrex("{@Relation(Mod:5=0)}")
? oNx5.Match(10)
#--> TRUE
? oNx5.Match(13)
#--> FALSE
oNx4 = new stzNumbrex("{@Digit4}")
? oNx4.Match(1234)
#--> TRUE
? oNx4.Match(123)
#--> FALSE1 0 1 0
ran: the promise is kept · in all four editions
This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)
The exercises
Every exercise proves itself: its wrong answers are refused and its right answers accepted.
ex-09-01 · Exercise 9.1 · The shape of an order line
2 of 2 wrong answers refused, 2 of 2 right answers accepted
01-reversed-shape.ring refused · 02-only-one-line.ring refused · 01-number-then-text.ring accepted · 02-the-shape-as-data.ring accepted

