One object, any structure
This chapter has 6 cells and writes 12 promises. In each of its four editions its cells were run in one fresh process on 2026-10-08 20:15: English, 6 cells ran, 12 promises kept; Français, 6 cells ran, 12 promises kept; العربية, 6 cells ran, 12 promises kept; Hausa, 6 cells ran, 12 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 one-object-any-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 three questions, asked of a string
oS = new stzString("tea rice tea fish")
? oS.Contains("tea")
#--> TRUE
? oS.NumberOfOccurrence("tea")
#--> 2
? @@( oS.FindAll("tea") )
#--> [ 1, 10 ]1 2 [ 1, 10 ]
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. The same three questions, asked of a list
oL = new stzList([ "tea", "rice", "tea", "fish" ])
? oL.Contains("tea")
#--> TRUE
? oL.NumberOfOccurrence("tea")
#--> 2
? @@( oL.FindAll("tea") )
#--> [ 1, 3 ]1 2 [ 1, 3 ]
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. Same words, different units
? StzLen("tea rice tea fish")
#--> 17
? oL.NumberOfItems()
#--> 417 4
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. One function for both
? @@( StzFind("tea", "tea rice tea fish") )
#--> [ 1, 10 ]
? @@( StzFind("tea", [ "tea", "rice", "tea", "fish" ]) )
#--> [ 1, 3 ][ 1, 10 ] [ 1, 3 ]
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. Act the same way, and read the result carefully
? @@( oS.Removed("tea") )
#--> " rice fish"
oL.RemoveAll("tea")
? @@( oL.Content() )
#--> [ "rice", "fish" ]" rice fish" [ "rice", "fish" ]
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 6 · 6. Your workplace, both ways
aReq = EduWorldObjects("requested")
? StzListQ(aReq).NumberOfOccurrence(aReq[1])
? Q( Q(aReq).Joined(" ") ).NumberOfOccurrence(aReq[1])3 3
ran: this cell writes no promise
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-05-01 · Exercise 5.1 · Same question, two shapes
2 of 2 wrong answers refused, 2 of 2 right answers accepted
01-counts-the-words.ring refused · 02-counts-the-items.ring refused · 01-same-question-twice.ring accepted · 02-one-function-for-both.ring accepted

