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  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Page 18 : 26
Document Description and Processing in Scheme
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"))

The indent-pixels function. annotation

 

(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")))

The use of the indent-pixels function.