【文件属性】:
文件名称:gofp:Clojure 语言的玩具解释器
文件大小:10KB
文件格式:ZIP
更新时间:2021-06-23 06:00:41
Go
高尔夫球场
类似于 Clojure/Lisp 的函数式编程语言的玩具解释器。
例子:
> (defn accum [n] (if (= n 0) 0 (+ n (accum (- n 1)))))
ast.DefnExpr {
. Ident: ast.IdentExpr {
. . Name: "accum"
. }
. Expr: ast.FuncExpr {
. . Params: []*ast.IdentExpr (len = 1) {
. . . 0: ast.IdentExpr {
. . . . Name: "n"
. . . }
. . }
. . Expr: ast.IfExpr {
. . . Cond: ast.BinaryOp {
. . . . Op: "="
. . . . Left: ast
【文件预览】:
gofp-master
----main.go(819B)
----token()
--------token.go(1KB)
----scanner()
--------scanner_test.go(1KB)
--------scanner.go(2KB)
----ast()
--------scope.go(438B)
--------object.go(1007B)
--------ast.go(9KB)
--------scope_test.go(418B)
--------print.go(2KB)
----parser()
--------parser_test.go(715B)
--------parser.go(5KB)
----README.md(2KB)