Skip to content

Instantly share code, notes, and snippets.

View tanishiking's full-sized avatar
🎓

Rikito Taniguchi tanishiking

🎓
View GitHub Profile
@nickcarenza
nickcarenza / lazy_evaluation.go
Created February 20, 2015 18:35
Golang Lazy Evaluation
package main
import (
"time"
)
type LazyInt chan func() int
// Can't use pointer receiver: invalid operation: l <- (func literal) (send to non-chan type *LazyInt)
func (l LazyInt) Future(i int) {
def index(id:String) = Action {
getFirstData(id)
}
private def getFirstData(id:String) = {
Cache.get(id) match {
case Some(id2) => getSecondData(id2)
case None => NotFound
}
}
private def getSecondData(id2:String) = {
@j5ik2o
j5ik2o / gist:1520836
Last active January 3, 2017 17:09
Scalaで使えそうなWeb系フレームワーク&ライブラリ