Welcome to the CHICKEN Scheme pasting service

Ersatz: sexpr->tvalue pasted by Guest79512 on Fri May 30 18:54:37 2014

(define sdata '(
    (webroot "http://localhost:8000/")
))

(vhost-map
   `(("localhost" . ,(uri-match/spiffy
       `(((/ "") (GET ,(lambda (continue)
            (send-response
                status: 'ok
                body: (from-file "index.tpl" 
                    env: (template-std-env search-path: '("tpl"))
                    models: (sexpr->tvalue sdata)
                )
            )
        ))))
    )))
)

;; In the template:
;; <!doctype html>
;; <html>
;;   <head>
;;     <base href="{{webroot}}">
;;     <title>Test</title>
;;   </head>
;;   <body>Test</body>
;; </html>

map-templates added by mario-goulart on Fri May 30 19:20:43 2014

(define (map-templates data)
  (map (lambda (item)
         (cons (car item) (sexpr->tvalue (cadr item))))
       data))

(define sdata
  (map-templates
   '((webroot "http://localhost:8000/"))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which egg implements a Scheme to JavaScript compiler?
Visually impaired? Let me spell it for you (wav file) download WAV