《The Little Schemer》的原文摘录

  • ... (and ...) 和 (or ...) 都不能被定义成像 (cond ...) 那样的功能, 尽管(and ...) 和 (or ...) 可以通过 (cond ...)表达式的方式表示出来: (查看原文)
    江南游子 2019-11-11 23:47:48
    —— 引自章节:第5章 我的天!都是星星 80
  • Scheme(或 Lisp) 中的 pair, 其两个元素是含义不同但相关的对象. (查看原文)
    江南游子 2019-11-11 23:47:48
    —— 引自章节:第7章 朋友及关系 110
  • 从现在开始, 我们将使用等宽字体来表述一个原子. (查看原文)
    江南游子 2019-11-11 23:47:48
    —— 引自章节:第10章 值是什么 174
  • The Five Rules The Law of Car: the primitive car is defined only for non-empty lists The Law of Cdr: the primitive cdr is defined only for non-empty lists.The cdr of any non-empty list is always another list. The Law of Cons: The primitive cons takes two arguments. The second argument to cons must be a list. The result is a list. The Law of Null?: the primitive null? is defined only for lists. The Law of Eq?: the primitive eq? takes two arguments. Both of them must be non-numeric atoms. <cons> takes two arguments: the first one is any S-expression; the second one is any list. <atom?>take a argument. The argument can be any S-expression. (查看原文)
    lili 2011-06-06 17:06:24
    —— 引自第1页
  • The First Commandment: Always ask null? as the first question in expressing any function. The Second Commandment: Use cons to build lists. The Third Commandment: When building a list, describe the first typical element,and then cons is onto the natural recursion. The Fourth Commandment: Always change at least one argument while recurring. It must be changed to be closer to termination. The changing argument must be tested int the termination condition; when using cdr, test termination with null? (查看原文)
    lili 2011-06-06 20:29:53
    —— 引自第15页
  • First: When recurring on a list of atomes, lat, ask two questions about it: (null? lat) and else. When recurring on a number, n, ask two questions about it: (zero? n) and else. Second: When building a value with +,always use 0 fro the value of the terminating line, for adding 0 does not change the value of an addition. When building a value with *,always use 1 for the value of the terminating line, for multiplying by 1 does not change the value of a multiplication. When building a value with cons,alway consider null-list for the value of the terminating line. (查看原文)
    lili 2011-06-08 09:28:20
    —— 引自第60页
  • When recurring on a list of S-expressions, l, ask three question about it: (null? l), (atom? (car l)), and else. Simplify only after the function correct. (查看原文)
    lili 2011-06-09 10:14:42
    —— 引自第81页
  • The First Commandment (preliminery) Always ask null? as the first question in expressing any function. (查看原文)
    jiuren 2013-08-16 01:27:50
    —— 引自第23页