chapter.go 353 Bytes
Newer Older
1 2
package tour

3 4
import "fmt"

5
// returns a partially applied function.
6 7 8 9 10
//
// It's designed to make it easy to re-order chapters with minimal fuss.
//
// eg.
// 		Intro := Chapter(1)
Brian Tiger Chow's avatar
Brian Tiger Chow committed
11
// 		ID("1.1") == Intro(1) == Chapter(1)(1)
12 13 14 15 16
func Chapter(number int) func(topic int) ID {
	return func(topic int) ID {
		return ID(fmt.Sprintf("%d.%d", number, topic))
	}
}