Skip to content

Instantly share code, notes, and snippets.

@yminsky
Created June 23, 2015 11:01
Show Gist options
  • Select an option

  • Save yminsky/8773a39663332ef00a50 to your computer and use it in GitHub Desktop.

Select an option

Save yminsky/8773a39663332ef00a50 to your computer and use it in GitHub Desktop.
A possible bug?
#lang racket
(require web-server/servlet
web-server/servlet-env)
(require pict)
(require file/convertible)
(require xml)
(define (pict->svg pict)
(define svg-b (convert pict 'svg-bytes))
(define svg-s (bytes->string/utf-8 svg-b))
(string->xexpr svg-s))
(define (start req)
(response/xexpr
`(html
(body
,(pict->svg (text (number->string 1))) "-"
,(pict->svg (text (number->string 4))) "-"
,(pict->svg (text (number->string 5)))
))))
(serve/servlet start)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment