Slide 1

Slide 1 text

text/template

Slide 2

Slide 2 text

/* Package template implements data- driven templates for generating textual output.

Slide 3

Slide 3 text

Reading

Slide 4

Slide 4 text

Usage

Slide 5

Slide 5 text

type Inventory struct { Material string Count uint } sweaters := Inventory{"wool", 17} tmpl, _ := template.New(“test"). Parse("{{.Count}} items are made of {{.Material}}") tmpl.Execute(os.Stdout, sweaters)

Slide 6

Slide 6 text

- C K Ogden & I A Richards, 1923 The gostak destims the doshes

Slide 7

Slide 7 text

Correctness

Slide 8

Slide 8 text

if! with! range! index! len call! printf! js! urlquery eq! ne! gt! le! ! and! not! or

Slide 9

Slide 9 text

Seven Types of Ambiguity - William Empson, 1930

Slide 10

Slide 10 text

Efficiency

Slide 11

Slide 11 text

// lex creates a new scanner for the input string.! func lex(name, input, left, right string) *lexer {! if left == "" {! left = leftDelim! }! if right == "" {! right = rightDelim! }! l := &lexer{! name: name,! input: input,! leftDelim: left,! rightDelim: right,! items: make(chan item),! }! go l.run()! return l! }

Slide 12

Slide 12 text

• Referential • Aesthetic • Emotive • Conative • Phatic • Metalingual - Roman Jacobson, 1960

Slide 13

Slide 13 text

Extend

Slide 14

Slide 14 text

html/template

Slide 15

Slide 15 text

Structure, Sign & Play - Jaques Derrida, 1966

Slide 16

Slide 16 text

History

Slide 17

Slide 17 text

2014-02: 1! 2013-12: 1! 2013-09: 4! 2013-08: 6! 2013-07: 3! 2013-05: 1! 2013-03: 5! 2013-01: 2! 2012-10: 4! 2012-09: 3! 2012-08: 6! 2012-07: 4! 2012-06: 1! 2012-05: 1! 2012-09: 4! 2012-04: 3! 2012-06: 1! 2012-04: 6! 2012-03: 6! 2012-02: 10! 2012-01: 6! 2011-12: 5! 2011-11: 12 64 [email protected]! 4 [email protected]! 3 [email protected]! 3 [email protected]! 2 [email protected]! 2 [email protected]! 2 [email protected]! 2 [email protected]! 2 [email protected]! 2 [email protected]! 2 [email protected]! 1 [email protected]! 1 [email protected]! 1 [email protected]! 1 [email protected]! 1 [email protected]! 1 [email protected]! 1 [email protected]

Slide 18

Slide 18 text

Qu’est-ce qu’un auteur? - Michel Foucault, 1967

Slide 19

Slide 19 text

No content