Sections and Steps
Numbered, parallel, and nested steps, organised into sections
Steps
The individual actions in a Technique are steps. They can stand alone as the body of a document, or be enclosed inside a procedure.
When a step is finished its result is immutable. Unless it generates a value, the result of a step is simply the observation that it has been completed; it is done.
Dependent Steps
Tasks that must be completed in order are dependent steps. A dependent step is formed by writing
- a numeric ordinal; followed by
- a
.character; followed by - one or more whitespace characters; followed by
- the content describing the action to be taken.
For example:
1. Make sure you know where your towel is
2. Signal a passing ship with your Sub-Etha device
3. Hitch a ride before your planet gets blown up
Parallel Steps
Steps that can be done in any order or concurrently are parallel steps and can be written as
- a
-character; followed by - one or more whitespace characters; followed by
- the content describing the action to be taken.
as shown here:
- Eat peanuts
- Drink pint
Dependent Substeps
Steps can have dependent substeps formed as follows
- a single lower-case letter character (but not
i,v, orx); followed by - a
.character; followed by - one or more whitespace characters; followed by
- the content describing the action to be taken.
Conventionally these would be further indented by 4 spaces,
1. Since you're going to have to live in the place, you better start
finding out something about it. To use the book,
a. Take cover off
b. Press button
c. Wait for screen to light up
d. Enter query
e. Read article
Step 1 is complete when substeps a through e have been completed in order.
Dependent substeps can of course also be nested under parallel steps:
- Listen to announcements from the captain
a. Put fish in your ear
b. Understand everything that is being said
These two substeps must be completed in order. The parent Listen to announcements step is complete when both a and b have been done.
Parallel Substeps
Steps can also have parallel substeps.
3. Appreciate poetry
- Note effectiveness of the metaphysical imagery
- Counterpoint the surrealism of the underlying metaphor
- Obtain profound and vivid insight into whatever the poem was about
These three substeps can be completed in any order, and step 3 is complete when all have been done.
Parallel steps can not contain parallel substeps as immediate children. Because Technique is as tolerant as possible of arbitrary whitespace there is no way for the parser to disambiguate between them
- Explorers
- Men
- Women
- Small fuzzy creatures from Alpha Centauri
so if this were written it would be parsed (and code formatted) as four parallel items, clearly incorrect. If something creates a scope between them, an attribute or control statement for example, then it can be disambiguated:
- Attempt to avoid being thrown out the airlock
@field_researcher
- Chat with the guard, concurrent with
- Look for a means of escape.
Dependent Subsubsteps
Technique supports a third level of depth within a step, and that is a dependent sub-substep. These are indicated using roman numerals (as opposed to numerals for steps, alphabetic characters for substeps) and formed with
- one or more lower-case
i,v, orxcharacters; followed by - a
.character; followed by - one or more whitespace characters; followed by
- the content describing the action to be taken.
The code formatter built into the technique program will do its best to align content at four spaces indented but it will do what it has to in order to accommodate wider ordinals:
demolition :
# Build hyperspace bypass through solar system
First we need to destroy the planets in the solar system that are in the way
of our hyperspatial express route. We'll leave Pluto alone; it's the cutest
and apparently not a planet.
1. Build bypass through solar system
a. Demolish all the planets. Each one should take slightly less than
two Earth minutes to complete.
i. Mercury
ii. Venus
iii. Mostly Harmless
iv. Mars
v. Asteroid Belt (already done?)
vi. Jupiter
vii. Saturn
viii. Uranus
ix. Neptune
x. Eris
xi. Haumea
xii. Makemake
Sub-substeps are the maximum depth supported by the Technique syntax. If you need any more nesting than this you can invoke another procedure.
xiii. Even more rocks out there <cleanup_oort_cloud>
Sections
There is one level of organization above step and that is the section. Sections are indicated as left-aligned headings using roman capitals. Specifically
- one or more upper-case
I,V, orXcharacters; followed by - a
.character; followed by - content indicating the name of the section.
Naked Sections
A list of section headings is a valid Technique document:
I. File planning documents and demolition orders
II. Destroy planet(s)
III. Enjoy shore leave
Sections can contain steps:
I. File planning documents and demolition orders
1. Fill out the paperwork
2. Drop it off at the local planning department
II. Destroy planet(s)
1. Approach planet
2. Make announcement
3. Energize demolition beams
Sections with Procedures
Except when writing a casual outline, sections are more likely to be used to give structure to a larger procedure, where they make up the division of the body of the top-level procedure in a Technique document.
build_hyperspace_express_route :
I. File planning documents and demolition orders
II. Destroy planet(s)
III. Enjoy shore leave
Likewise sections can contain and thereby group procedures together:
build_hyperspace_express_route :
I. File planning documents and demolition orders
file_planning_documents :
wait_fifty_years :
II. Destroy planet(s)
demolition :
III. Enjoy shore leave
hyperspace_jump_to_next_star :
disembark_for_shore_leave :
This grouping of procedures (and thus their steps) is the primary role sections play in the Technique language.