Lecture overview -- Keyboard shortcut: 'u'  Previous page: Open table forms -- Keyboard shortcut: 'p'  Next page: How to query HTML documents -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Slide 18 : 26

XML-in-LAML abstractions
How can I make my own functions with mirror function parameter passing?
(define indent-pixels
 (xml-in-laml-abstraction
  (lambda (content attributes)
    (let ((i (get-prop 'indentation attributes))
          (reduced-attributes (but-props attributes '(indentation))))
      (table 'border 0
         (tr (td 'width i)
             (td 'width "*" content reduced-attributes)))))
  (required-implied-attributes '(indentation) '(*) "index-pixels")
  "indent-pixels"))
(write-html '(pp prolog)
 (html 
  (head 
   (title "Table Examples"))
  (body
    (p "First paragraph")
    (indent-pixels 'indentation "50" 'id "x"
      (p "Second paragraph")
      (p "Third paragraph"))
    (p "Fourth paragraph")))