by amelius · 11y ago · 0 comments
* John goes to the store and meets a woman named Jane.
* Wait, actually her name is Alice and she works at the store.
* John tells Alice that he is looking for a widget.
* Alice looks for the widget and shows John a list of what she found.
* John can't read the list.
* John takes a photo of the list and sends it to his friend Jane.
* Jane reads the list and texts what she thinks it says back to John.
* John promises to get back to Alice once he can read the list.
* John gets Jane's SMS. John can't read Jane's SMS.
* John throws his hands in the air.You are following the illusion of how that code is delivered and not how that code was created.
This demo hides from you the countless iterations until it got the result right to later linearly deploy.
Your brain knows that creativity is non-linear so you perceive this as an act of genius.
They would write text, then a code block:
func main() {
<main body variable declarations>
<main body functions>
}
followed by another block of text, and then an expansion of the code <main body variable declarations> =
var foo int
var bar int64
And so on. <main body variable declarations> +=
var zed rune
Which, when run through the "tangler", would produce: func main () {
var foo int
var bar int64
var zed rune
}
The first really interesting implementation I've seen of literate programming, and it makes me want to implement it myself.10 FOR i = 1 TO 64 90 NEXT
REM What should we do inside? 50 PRINT "Hello", i, "worlds."
REM nah, too many iterations. 10 FOR i = 1 TO 16