You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

templates.scm 408B

1234567891011121314
  1. (module templates (render-template)
  2. (import scheme (chicken string))
  3. (define (render-template node)
  4. (cond
  5. ((eq? node '()) "")
  6. ((string? node) node)
  7. (else
  8. (let* ([tag (symbol->string (car node))]
  9. [body (cdr node)])
  10. (string-append
  11. "<" tag ">"
  12. (string-intersperse (map render-template body) "")
  13. "</" tag ">"))))))