Skip to content

Instantly share code, notes, and snippets.

@rightfold
Created April 27, 2014 01:53
Show Gist options
  • Save rightfold/0a0a6e9c7d4ba19cbf4c to your computer and use it in GitHub Desktop.
Save rightfold/0a0a6e9c7d4ba19cbf4c to your computer and use it in GitHub Desktop.
(define http (require "http"))
(define !
(lambda (n)
(if (< n 2)
1
(* n (! (pred n))))))
(define all
(lambda (xs)
(or (empty? xs)
(and (head xs)
(all (tail xs))))))
(.log $console (all '(1 2 3 4 5 6)))
(define server
(.createServer http
(lambda (req res)
(let (n (int (drop 1 (:url req)))
f (! n))
(.end res (string f))))))
(.listen server 1337)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment