很喜欢Lisp这门语言。最初接触是在用gimp时无意了解到的,因为gimp可以使用Script-Fu写脚本,而这门语言基于Scheme,这个时候的了解仅限于大体的语法。随后,接触了Emacs的elisp,也仅仅是简单的文件配置。总体上,对Lisp语言的了解是零星、不系统的。是时候好好学习一下了。
Lisp方言很多,最后选择了Scheme进行系统学习,最吸引我的大体有两点:
- 语言很小,语言规范的内容也才有50多页【R7RS small】
- 麻雀虽小,五脏俱全
看到Ninety-Nine Prolog Problems和Ninety-Nine Lisp Problems两篇,作为学习和实践资料,这里给出其Scheme版本。
问题的组织方式基本与Ninety-Nine Prolog Problems和Ninety-Nine Lisp Problems类似,99个问题分为以下7类:
1. 列表操作(Working with lists)
2. 算术计算(Arithmetic)
3. 逻辑和编码(Logic and Codes)
4. 二叉树(Binary Trees)
5. 多叉树(Multiway Trees)
6. 图(Graphs)
7. 其他(Miscellaneous Problems)
每个问题的前面都有星号表示难度的等级,引用Ninety-Nine Prolog Problems的说明
The problems have different levels of difficulty. Those marked with a single asterisk (*) are easy. If you have successfully solved the preceeding problems you should be able to solve them within a few (say 15) minutes. Problems marked with two asterisks (**) are of intermediate difficulty. If you are a skilled Prolog programmer it shouldn’t take you more than 30-90 minutes to solve them. Problems marked with three asterisks (***) are more difficult. You may need more time (i.e. a few hours or more) to find a good solution.
当前最新的语言规范是r7rs,给出的代码符合该标准。,包括各个版本的语言规范和各个实现对标准的支持情况。目前符合r7rs-small标准的实现不太多,我使用的sagittarius-scheme。
本文发布于:2024-01-30 17:44:52,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170660789421745.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |