https://github.com/pysrc/make_lisp
用go语言实现的简单的Lisp解析器
https://github.com/pysrc/make_lisp
easy-to-use golang lisp lisp-interpreter
Last synced: 5 months ago
JSON representation
用go语言实现的简单的Lisp解析器
- Host: GitHub
- URL: https://github.com/pysrc/make_lisp
- Owner: pysrc
- Created: 2018-04-02T15:25:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-12T03:21:21.000Z (over 7 years ago)
- Last Synced: 2025-02-05T23:40:04.222Z (11 months ago)
- Topics: easy-to-use, golang, lisp, lisp-interpreter
- Language: Go
- Size: 7.04 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 用Go实现仿Lisp解释器
觉得自己写一个语言很有成就感,其实也没什么特别牛逼的东西,就是实现一些概念,把过程中的坑点记录下来了,项目参考 https://github.com/kanaka/mal 的实现,由于英文不好,一边做一边看这位兄弟 https://github.com/Windfarer/mal-zh 的中文翻译,翻译得很好。没有实现Lisp的全部功能,只实现了基本的运算功能
## 示例
```lisp
// fib.txt
S:
(fn // 斐波拉契数列递归式
fib
[n]
{
(if
(<= n 2)
{
(ret 1)
}
{
(ret
(+
(fib (- n 1))
(fib (- n 2))
)
)
}
)
}
)
:E
(out (fib 6))
```
`main.exe fib.txt`
[更多示例请看这里](/一些示例)