This example is written in a style of literate programming (Knuth 1984). The combined code-blocks in this example compose a compilable source code for “Hello World”. For didactic reasons we don’t always give the listing of an entire source file in one go. In stead, we use a system of references known as noweb (Ramsey 1994).
Inside source fragments you may encounter a line with <<...>>
marks like,
which is then elsewhere specified. Order doesn’t matter,
So we can reference the <<hello-world>>
code block later on.
A definition can be appended with more code as follows (in this case, order does matter!):
These blocks of code can be tangled into source files.
References
Knuth, Donald Ervin. 1984. “Literate Programming.” The Computer Journal 27 (2): 97–111.
Ramsey, Norman. 1994. “Literate Programming Simplified.” IEEE Software 11 (5): 97–105.