Lecture overview -- Keyboard shortcut: 'u'  Previous page: Recipe datastructure (1) -- Keyboard shortcut: 'p'  Next page: A Recipe XML language -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Page 19 : 30
XML Processing in LAML
Recipe datastructure (2)

Representing recipes as lists in Scheme

(define (present-recipe r)
  (div 'class "recipe"
    (h3 (title-of-recipe r))
    (b "Ingredients")
    (ul      
      (map 
        (compose li present-ingredient) 
        (ingredient-list-of-recipe r)))
    (b "Procedure:")
    (ol(map li (steps-of-recipe r)))))

A recipe list structure.

/user/normark/scheme/slides/goerlitz-05/xml-processing-in-laml/includes/recipes-ds/recipes.lamlEntire document.

Entire document.

 

A raw list approach - Easy to make errors in list structure - misspelling and structural errors