My efforts to port http://www.youtube.com/watch?v=f6kdp27TYZs to Clojure.
func boring(msg string) {
for i := 0; ; i++ {
fmt.Println(msg, i)
time.Sleep(time.Second)
}| module Main where | |
| import Data.Monoid (mappend) | |
| import Data.Maybe (fromMaybe, listToMaybe, maybe) | |
| import System.Environment (getArgs) | |
| fizzbuzz i = fromMaybe (show i) $ mappend ["fizz" | i `rem` 3 == 0] | |
| ["buzz" | i `rem` 5 == 0] | |
| main = mapM_ putStrLn [ fizzbuzz i | i <- [1..100] ] |
| /* | |
| turns a binary function into a variadic function via reduction | |
| */ | |
| var reducify = function(fn){ | |
| return function(){ | |
| var args = [].slice.call(arguments) | |
| return args.reduce(fn) | |
| } |
My efforts to port http://www.youtube.com/watch?v=f6kdp27TYZs to Clojure.
func boring(msg string) {
for i := 0; ; i++ {
fmt.Println(msg, i)
time.Sleep(time.Second)
}When watching David Nolen's excellent Lambda Jam keynote on InfoQ, the references to interesting reading came a little too fast and furious for me to jot down, so I went through the slides and put this gist together.
| #! /usr/bin/env sh | |
| RUBY_VERSION="1.9.1" | |
| SERVER="${HOME}/.gem/ruby/${RUBY_VERSION}/bin/camper_van" | |
| PIDFILE="/tmp/camper_van.pid" | |
| if [ ! -e ${SERVER} ]; then | |
| echo "CamperVan server not found at '${SERVER}'." | |
| fi |
| # Functional JS - Event Handler | |
| ## What is FP: 15 mins [tim] | |
| ## Defining features: 5 | |
| ### Vs OOP: 5 | |
| - flat |