Stop show with sound -- Keyboard shortcut: 'x'  Next slide in show -- Keyboard shortcut: 'n'  2 minutes, 45 secondsHigher-order Functions - slide 28 : 34

HTML mirror usage examples

The example assumes loading of laml.scm and the function map-concat, which concatenates the result of a map application.

The real mirrors use implicit (string) concatenation

Expression

Value

(let* ((functions
         (map generate-double-tag-function 
              (list "table" "td" "tr")))
       (table (car functions))
       (td (cadr functions))
       (tr (caddr functions)))
 (table
  (string-append
   (tr 
     (map-concat td (list "c1" "c2" "c3"))
     'bgcolor "#ff0000")
   (tr
     (map-concat td (list "c4" "c5" "c6")))
   (tr
     (map-concat td (list "c7" "c8" "c9"))))
  'border 3))
<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