Lisp 方言:GoLio

jopen 11年前

GoLio 是一个使用 OCaml 实现的 Lisp 方言,语法、语义和库都是 R5RS 的子集,提供一个重要的扩展:类似 Go 的并发模型。

> (define (curry func arg1) (lambda (arg) (apply func arg1 (list arg))))  > (map (curry + 2) '(1 2 3 4))  (3 4 5 6) ;; just plain old s-expressions    > (letrec ((even? (lambda (n) (if (= 0 n) #t (odd? (- n 1)))))             (odd?  (lambda (n) (if (= 0 n) #f (even? (- n 1))))))             (even? 9875321))  #f ;; proper tail recursion is implemented    > `(1 2 `(10 ,',(+ 2 3)))  (1 2 `(10 ,'5)) ;; nested quasiquote is not very easy to implement right

项目主页:http://www.open-open.com/lib/view/home/1352687368558