Lecture overview -- Keyboard shortcut: 'u'  Previous page: Combination of mirror functions: Tables (1) -- Keyboard shortcut: 'p'  Next page: Open table forms -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Page 16 : 26
Document Description and Processing in Scheme
Combination of mirror functions: Tables (2)

A similar table example

Switching the first two columns of the table

(define row list)  (define cell list)

(define (col-switch row-lst) 
 (cons (second row-lst)
  (cons (first row-lst) (cddr row-lst))))

(define sample-table
 (list
  (row "This" "is" "row" "1")
  (row "This" "is" "row" "2")
  (row "This" "is" "row" "3")
  (row "This" "is" "row" "4")))

(write-html '(pp prolog)
 (html 
  (head 
   (title "Table Examples"))
  (body 
    (table 'border "1" (map (compose tr (map td) col-switch) sample-table) )
   )))   

A idiomatic table presentation pattern in LAML.