Lecture overview -- Keyboard shortcut: 'u'  Previous page: HTML mirror usage examples -- Keyboard shortcut: 'p'  Next page: Tables with higher-order functions -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home    Lecture 4 - Page 29 : 34
Functional Programming in Scheme
Higher-order Functions
Making tables with the real mirror

The real mirror provide for more elegance than the simple mirror illustrated above

Here we will use the XHTML1.0 transitional mirror

Expression

Rendered value

(table
  'border 3
   (tr 
     (map td (list "c1" "c2" "c3"))
     'bgcolor "#ff0000")
   (tr
     (map td (list "c4" "c5" "c6")))
   (tr
     (map td (list "c7" "c8" "c9")))
)
<table border = "3">
  <tr bgcolor = "#ff0000">
   <td>c1</td>
   <td>c2</td>
   <td>c3</td>
  </tr> 
  <tr>
   <td>c4</td> 
   <td>c5</td> 
   <td>c6</td>
  </tr> 
  <tr>
    <td>c7</td>
    <td>c8</td>
    <td>c9</td>
  </tr>
</table>
Same as above
c1 c2 c3
c4 c5 c6
c7 c8 c9

A XHTML mirror expression with a table corresponding to the table shown on the previous page and the corresponding HTML fragment. Notice the absence of string concatenation. Also notice that the border attribute is given before the first tr element. The border attribute could as well appear after the tr elements, or in between them.