Showing posts with label plt. Show all posts
Showing posts with label plt. Show all posts

Monday, June 7, 2010

Racket

Racket is the new name for DrScheme. Here is a simple webserver in Racket:
#lang web-server/insta
(define (start request)
  '(html
    (head (title "My blog"))
    (body (h1 "Under construction")
          (p "Imagine a rocking website here")
          (p "Should be pretty froody"))))

Unhygenic macros in PLT Scheme

You need language "pretty big" for this to work. The following is a demonstration of "anaphoric if"

(defmacro aif (a b c)
`(let ((it ,a))
(if it ,b ,c)))

(aif #f 2 3) ; returns 3
You may need to
(require mzlib/defmacro)