版本1和19间的区别 (跳过第18版)
于2007-04-16 09:41:52修订的的版本1
大小: 1465
编辑: czk
备注:
于2008-02-23 15:35:42修订的的版本19
大小: 629
编辑: localhost
备注: converted to 1.6 markup
删除的内容标记成这样。 加入的内容标记成这样。
行号 1: 行号 1:
[[TableOfContents]] [[http://mitpress.mit.edu/sicp/full-text/book/book.html|Structure and Interpretation of Computer Programs, 2nd Edition]]这本书中的Lisp代码用Python语言重新实现后写在这里,主要目的是供使用Python的人学习函数式编程作参考。
行号 3: 行号 4:
== The Elements of Programming ==
=== Expressions ===
{{{
486
}}}
{{{#!python
486
}}}
{{{
(+ 137 349)
486
(- 1000 334)
666
(* 5 99)
495
(/ 10 5)
2
(+ 2.7 10)
12.7
}}}
{{{#!python
137 + 349
1000 - 334
5 * 99
10 / 5
2.7 + 10
}}}
{{{
(+ 21 35 12 7)
75

(* 25 4 12)
1200
}}}
{{{#!python
21 + 35 + 12 + 7
25 * 4 * 12
}}}
或者{{{
reduce(int.__add__, [21, 35, 12, 7])
reduce(int.__mul__, [25, 4, 12])
}}}

            1.1.2 Naming and the Environment
            1.1.3 Evaluating Combinations
            1.1.4 Compound Procedures
            1.1.5 The Substitution Model for Procedure Application
            1.1.6 Conditional Expressions and Predicates
            1.1.7 Example: Square Roots by Newton's Method
            1.1.8 Procedures as Black-Box Abstractions
        1.2 Procedures and the Processes They Generate
            1.2.1 Linear Recursion and Iteration
            1.2.2 Tree Recursion
            1.2.3 Orders of Growth
            1.2.4 Exponentiation
            1.2.5 Greatest Common Divisors
            1.2.6 Example: Testing for Primality
        1.3 Formulating Abstractions with Higher-Order Procedures
            1.3.1 Procedures as Arguments
            1.3.2 Constructing Procedures Using Lambda
            1.3.3 Procedures as General Methods
            1.3.4 Procedures as Returned Values
<<Include(/SICP的Python实现1.1,,titlesonly, editlink)>>
<<Include(/SICP的Python实现1.2,,titlesonly, editlink)>>
<<Include(/SICP的Python实现1.3,,titlesonly, editlink)>>
= Building Abstractions with Data =
= Modularity, Objects, and State =
= Metalinguistic Abstraction =
= Computing with Register Machines =

SICP的Python实现 (2008-02-23 15:35:42由localhost编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.