Back to slide -- Keyboard shortcut: 'u'        next  steel.laml - Use of a text steeling function.Slide 22 : 26
Program 1

(load (string-append laml-dir "laml.scm"))
(laml-style "simple-xhtml1.0-transitional-validating")
(lib-load "xhtml1.0-convenience.scm")

; Higher-order function that 'steels' text from the first
; occurrence (if any) of element-name.
(define (steel-text-from element-name)
  (lambda (root-ast parent-ast)
    (let ((relevant-ast (find-first-ast root-ast element-name)))
      (if relevant-ast (ast-text-deep relevant-ast) "???"))))


(write-html '(pp prolog)
 (html
  (head 
    (title (steel-text-from "h1")))
  (body 
    (h1 "Demo of simple document reflection")

    (p "This is a demo of simple document introspection aided by" 
       (em "delayed procedural content items")_"." )

    (when-generated)
  )))

(end-laml)