mirror of https://gitee.com/XmacsLabs/planet.git
wip
This commit is contained in:
parent
277099a83d
commit
59ba6676b8
147
SICP/slide11.tm
147
SICP/slide11.tm
|
@ -15,14 +15,26 @@
|
||||||
|
|
||||||
\;
|
\;
|
||||||
|
|
||||||
|
<doc-data|<doc-title|\<#96F6\>\<#57FA\>\<#7840\>SICP
|
||||||
|
11>|<doc-author|<author-data|<author-name|>>>|<doc-author|<author-data|<author-name|\<#6C88\>\<#6D6A\>\<#718A\>\<#732B\>\<#513F\>>>>|<doc-author|<author-data|<author-name|MathAgape>|<\author-affiliation>
|
||||||
\;
|
\;
|
||||||
|
|
||||||
<doc-data|<doc-title|\<#96F6\>\<#57FA\>\<#7840\>SICP
|
\;
|
||||||
11>|<doc-author|<author-data|<author-name|>>>|<doc-author|<author-data|<author-name|\<#6C88\>\<#6D6A\>\<#718A\>\<#732B\>\<#513F\>>>>|<doc-author|<author-data|<author-name|MathAgape>>>|<doc-subtitle|\<#7B26\>\<#53F7\>\<#6570\>\<#636E\>\<#548C\>\<#7B26\>\<#53F7\>\<#6C42\>\<#5BFC\>>>
|
|
||||||
|
\;
|
||||||
|
|
||||||
|
\;
|
||||||
|
|
||||||
|
\;
|
||||||
|
|
||||||
|
\;
|
||||||
|
|
||||||
|
\;
|
||||||
|
</author-affiliation>>>|<doc-subtitle|\<#7B26\>\<#53F7\>\<#6570\>\<#636E\>\<#548C\>\<#7B26\>\<#53F7\>\<#6C42\>\<#5BFC\>>>
|
||||||
</slide>
|
</slide>
|
||||||
|
|
||||||
<\slide>
|
<\slide>
|
||||||
<tit|\<#96F6\>\<#57FA\>\<#7840\>SICP\<#FF1A\>\<#7B2C\>10\<#8BFE\>>
|
<tit|\<#96F6\>\<#57FA\>\<#7840\>SICP\<#FF1A\>\<#7B2C\>11\<#8BFE\>>
|
||||||
|
|
||||||
<\wide-tabular>
|
<\wide-tabular>
|
||||||
<tformat|<cwith|2|-1|1|-1|cell-height|40px>|<cwith|2|-1|1|-1|cell-vmode|exact>|<table|<row|<\cell>
|
<tformat|<cwith|2|-1|1|-1|cell-height|40px>|<cwith|2|-1|1|-1|cell-vmode|exact>|<table|<row|<\cell>
|
||||||
|
@ -33,10 +45,18 @@
|
||||||
<\large>
|
<\large>
|
||||||
<strong|Introduction to Data Abstraction>
|
<strong|Introduction to Data Abstraction>
|
||||||
</large>
|
</large>
|
||||||
|
</cell>>|<row|<\cell>
|
||||||
|
\;
|
||||||
|
</cell>|<\cell>
|
||||||
|
\;
|
||||||
</cell>>|<row|<\cell>
|
</cell>>|<row|<\cell>
|
||||||
<large|<strong|\<#5C42\>\<#6B21\>\<#6027\>\<#6570\>\<#636E\>\<#548C\>\<#95ED\>\<#5305\>\<#6027\>\<#8D28\>>>
|
<large|<strong|\<#5C42\>\<#6B21\>\<#6027\>\<#6570\>\<#636E\>\<#548C\>\<#95ED\>\<#5305\>\<#6027\>\<#8D28\>>>
|
||||||
</cell>|<\cell>
|
</cell>|<\cell>
|
||||||
<large|<strong|Hierarchical Data and the Closure Property>>
|
<large|<strong|Hierarchical Data and the Closure Property>>
|
||||||
|
</cell>>|<row|<\cell>
|
||||||
|
\;
|
||||||
|
</cell>|<\cell>
|
||||||
|
\;
|
||||||
</cell>>|<row|<\cell>
|
</cell>>|<row|<\cell>
|
||||||
<large|<strong|\<#7B26\>\<#53F7\>\<#6570\>\<#636E\>>>
|
<large|<strong|\<#7B26\>\<#53F7\>\<#6570\>\<#636E\>>>
|
||||||
</cell>|<\cell>
|
</cell>|<\cell>
|
||||||
|
@ -108,7 +128,7 @@
|
||||||
<\input>
|
<\input>
|
||||||
\<gtr\>\
|
\<gtr\>\
|
||||||
<|input>
|
<|input>
|
||||||
\;
|
(list? )
|
||||||
</input>
|
</input>
|
||||||
</session>
|
</session>
|
||||||
|
|
||||||
|
@ -120,7 +140,8 @@
|
||||||
<\slide>
|
<\slide>
|
||||||
<tit|\<#5B9A\>\<#4E49\>\<#7B26\>\<#53F7\>\<#6570\>\<#636E\>\V\<#6784\>\<#9020\>\<#51FD\>\<#6570\>quote>
|
<tit|\<#5B9A\>\<#4E49\>\<#7B26\>\<#53F7\>\<#6570\>\<#636E\>\V\<#6784\>\<#9020\>\<#51FD\>\<#6570\>quote>
|
||||||
|
|
||||||
<marked|<scm|'>>\<#662F\>\<#4E00\>\<#79CD\>\<#8BED\>\<#6CD5\>\<#7CD6\>\<#8863\>\<#FF0C\>\<#5982\>\<#679C\>\<#6CA1\>\<#6709\><marked|<scm|'>>\<#FF0C\>\<#4E5F\>\<#53EF\>\<#4EE5\>\<#4F7F\>\<#7528\><scm|quote>\<#3002\>Scala\<#91CC\>\<#9762\>\<#4E5F\>\<#6709\>\<#7B26\>\<#53F7\>\<#6570\>\<#636E\>\<#3002\>
|
<marked|<scm|'>>\<#662F\>\<#4E00\>\<#79CD\>\<#8BED\>\<#6CD5\>\<#7CD6\>\<#8863\>\<#FF0C\>\<#5982\>\<#679C\>\<#6CA1\>\<#6709\><marked|<scm|'>>\<#FF0C\>\<#4E5F\>\<#53EF\>\<#4EE5\>\<#4F7F\>\<#7528\><scm|quote>\<#3002\>Scala\<#91CC\>\<#9762\>\<#4E5F\>\<#6709\>\<#7B26\>\<#53F7\>\<#6570\>\<#636E\>\<#3002\>SRFI-1
|
||||||
|
List
|
||||||
|
|
||||||
<\with|par-columns|2>
|
<\with|par-columns|2>
|
||||||
<\session|s7|default>
|
<\session|s7|default>
|
||||||
|
@ -169,7 +190,7 @@
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
(eq? 1 (quote 1))
|
(eq? 1 (quote 1))
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
#t
|
#f
|
||||||
</folded-io>
|
</folded-io>
|
||||||
|
|
||||||
<\folded-io>
|
<\folded-io>
|
||||||
|
@ -204,13 +225,13 @@
|
||||||
#f
|
#f
|
||||||
</folded-io>
|
</folded-io>
|
||||||
|
|
||||||
<\unfolded-io>
|
<\folded-io>
|
||||||
\<gtr\>\
|
\<gtr\>\
|
||||||
<|unfolded-io>
|
<|folded-io>
|
||||||
''
|
''
|
||||||
<|unfolded-io>
|
<|folded-io>
|
||||||
#\<eof\>
|
#\<eof\>
|
||||||
</unfolded-io>
|
</folded-io>
|
||||||
|
|
||||||
<\input>
|
<\input>
|
||||||
\<gtr\>\
|
\<gtr\>\
|
||||||
|
@ -220,7 +241,9 @@
|
||||||
</session>
|
</session>
|
||||||
</with>
|
</with>
|
||||||
|
|
||||||
\<#5B57\>\<#9762\>\<#91CF\>\<#5728\>\<#5F15\>\<#7528\>\<#4E4B\>\<#540E\>\<#FF0C\>\<#8FD8\>\<#662F\>\<#5B57\>\<#9762\>\<#91CF\>\<#3002\>\<#7B26\>\<#53F7\>\<#5728\>\<#5F15\>\<#7528\>\<#4E4B\>\<#540E\>\<#FF0C\>\<#5219\>\<#53D8\>\<#6210\>\<#4E86\>\<#7B26\>\<#53F7\>\<#6570\>\<#636E\>\<#3002\>
|
\<#5B57\>\<#9762\>\<#91CF\>\<#FF08\>literally\<#FF09\>\<#5728\>\<#5F15\>\<#7528\>\<#FF08\>\<#4E24\>\<#6B21\>\<#5F15\>\<#7528\>\<#FF1F\>\<#FF09\>\<#4E4B\>\<#540E\>\<#FF0C\>\<#8FD8\>\<#662F\>\<#5B57\>\<#9762\>\<#91CF\>\<#3002\>\<#7B26\>\<#53F7\>\<#5728\>\<#5F15\>\<#7528\>\<#4E4B\>\<#540E\>\<#FF0C\>\<#5219\>\<#53D8\>\<#6210\>\<#4E86\>\<#7B26\>\<#53F7\>\<#6570\>\<#636E\>\<#3002\>
|
||||||
|
|
||||||
|
\;
|
||||||
</slide>
|
</slide>
|
||||||
|
|
||||||
<\slide>
|
<\slide>
|
||||||
|
@ -274,20 +297,14 @@
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
(quasiquote (unquote a))
|
(quasiquote (unquote a))
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
3
|
1
|
||||||
</folded-io>
|
</folded-io>
|
||||||
|
|
||||||
<\input>
|
|
||||||
\<gtr\>\
|
|
||||||
<|input>
|
|
||||||
\;
|
|
||||||
</input>
|
|
||||||
</session>
|
</session>
|
||||||
|
|
||||||
\<#8BD5\>\<#8BD1\>\<#FF1A\>quote\<#4E3A\>\<#5F15\>\<#7528\>\<#FF0C\>unquote\<#4E3A\>\<#89E3\>\<#5F15\>\<#7528\>\<#FF0C\>quasiquote\<#4E3A\>\<#53CD\>\<#5E94\>\<#7528\>\<#3002\><marked|<scm|'>>
|
\<#8BD5\>\<#8BD1\>\<#FF1A\>quote\<#4E3A\>\<#5F15\>\<#7528\>\<#FF0C\>unquote\<#4E3A\>\<#89E3\>\<#5F15\>\<#7528\>\<#FF0C\>quasiquote\<#4E3A\>\<#51C6\>\<#5F15\>\<#7528\>\<#3002\><marked|<scm|'>>
|
||||||
\<#662F\>\<#5F15\>\<#53F7\>\<#FF0C\><marked|<scm|,>>
|
\<#662F\>\<#5F15\>\<#53F7\>\<#FF0C\><marked|<scm|,>>
|
||||||
\<#662F\>\<#89E3\>\<#5F15\>\<#53F7\>\<#FF0C\><marked|<scm|`>>
|
\<#662F\>\<#89E3\>\<#5F15\>\<#53F7\>\<#FF0C\><marked|<scm|`>>
|
||||||
\<#662F\>\<#53CD\>\<#5F15\>\<#53F7\>\<#3002\>
|
\<#662F\>\<#51C6\>\<#5F15\>\<#53F7\>\<#3002\>
|
||||||
</slide>
|
</slide>
|
||||||
|
|
||||||
<\slide>
|
<\slide>
|
||||||
|
@ -342,21 +359,17 @@
|
||||||
</session>
|
</session>
|
||||||
|
|
||||||
<\scm-code>
|
<\scm-code>
|
||||||
' # quote
|
' ; quote
|
||||||
|
|
||||||
` # quasiquote
|
` ; quasiquote
|
||||||
|
|
||||||
, # unquote
|
, ; unquote
|
||||||
</scm-code>
|
</scm-code>
|
||||||
|
|
||||||
\;
|
|
||||||
</slide>
|
</slide>
|
||||||
|
|
||||||
<\slide>
|
<\slide>
|
||||||
<tit|\<#5B9A\>\<#4E49\>\<#7B26\>\<#53F7\>\<#6570\>\<#636E\>\V\<#5728\>\<#5217\>\<#8868\>\<#4E2D\>\<#7406\>\<#89E3\>\<#9009\>\<#62E9\>\<#51FD\>\<#6570\>>
|
<tit|\<#5B9A\>\<#4E49\>\<#7B26\>\<#53F7\>\<#6570\>\<#636E\>\V\<#5728\>\<#5217\>\<#8868\>\<#4E2D\>\<#7406\>\<#89E3\>\<#9009\>\<#62E9\>\<#51FD\>\<#6570\>>
|
||||||
|
|
||||||
\;
|
|
||||||
|
|
||||||
<\with|par-columns|2>
|
<\with|par-columns|2>
|
||||||
<\session|s7|default>
|
<\session|s7|default>
|
||||||
<\folded-io>
|
<\folded-io>
|
||||||
|
@ -370,9 +383,17 @@
|
||||||
<\folded-io>
|
<\folded-io>
|
||||||
\<gtr\>\
|
\<gtr\>\
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
(define a 3)
|
(define a 4)
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
3
|
4
|
||||||
|
</folded-io>
|
||||||
|
|
||||||
|
<\folded-io>
|
||||||
|
\<gtr\>\
|
||||||
|
<|folded-io>
|
||||||
|
`(+ ,(+ a 1) 1)
|
||||||
|
<|folded-io>
|
||||||
|
(+ 5 1)
|
||||||
</folded-io>
|
</folded-io>
|
||||||
|
|
||||||
<\folded-io>
|
<\folded-io>
|
||||||
|
@ -380,7 +401,7 @@
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
`(+ ,a 1)
|
`(+ ,a 1)
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
(+ 3 1)
|
(+ 4 1)
|
||||||
</folded-io>
|
</folded-io>
|
||||||
|
|
||||||
<\folded-io>
|
<\folded-io>
|
||||||
|
@ -388,14 +409,12 @@
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
(eval `(+ ,a 1))
|
(eval `(+ ,a 1))
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
4
|
5
|
||||||
</folded-io>
|
</folded-io>
|
||||||
</session>
|
</session>
|
||||||
|
|
||||||
\;
|
|
||||||
|
|
||||||
<\equation*>
|
<\equation*>
|
||||||
<frac|5+4+<around*|(|2-<around*|(|3-<around*|(|6+<frac|4|5>|)>|)>|)>|3<around*|(|6-2|)><around*|(|2-7|)>>
|
<frac|5+4+0*<around*|(|2-<around*|(|3-<around*|(|6+<frac|4|5>|)>|)>|)>|3<around*|(|6-2|)><around*|(|2-7|)>>
|
||||||
</equation*>
|
</equation*>
|
||||||
</with>
|
</with>
|
||||||
|
|
||||||
|
@ -455,29 +474,29 @@
|
||||||
<tit|\<#7B26\>\<#53F7\>\<#6C42\>\<#5BFC\>\V\<#5E94\>\<#7528\>>
|
<tit|\<#7B26\>\<#53F7\>\<#6C42\>\<#5BFC\>\V\<#5E94\>\<#7528\>>
|
||||||
|
|
||||||
<\session|s7|default>
|
<\session|s7|default>
|
||||||
<\input>
|
<\folded-io>
|
||||||
\<gtr\>\
|
\<gtr\>\
|
||||||
<|input>
|
<|folded-io>
|
||||||
(deriv '(+ x 3) 'x)
|
(deriv '(+ x 3) 'x)
|
||||||
</input>
|
<|folded-io>
|
||||||
|
(+ 1 0)
|
||||||
|
</folded-io>
|
||||||
|
|
||||||
<\input>
|
<\folded-io>
|
||||||
\<gtr\>\
|
\<gtr\>\
|
||||||
<|input>
|
<|folded-io>
|
||||||
(deriv '(* x y) 'x)
|
(deriv '(* x y) 'x)
|
||||||
</input>
|
<|folded-io>
|
||||||
|
(+ (* x 0) (* 1 y))
|
||||||
|
</folded-io>
|
||||||
|
|
||||||
<\input>
|
<\folded-io>
|
||||||
\<gtr\>\
|
\<gtr\>\
|
||||||
<|input>
|
<|folded-io>
|
||||||
(deriv '(* (* x y) (+ x 3)) 'x)
|
(deriv '(* (* x y) (+ x 3)) 'x)
|
||||||
</input>
|
<|folded-io>
|
||||||
|
(+ (* (* x y) (+ 1 0)) (* (+ (* x 0) (* 1 y)) (+ x 3)))
|
||||||
<\input>
|
</folded-io>
|
||||||
\<gtr\>\
|
|
||||||
<|input>
|
|
||||||
\;
|
|
||||||
</input>
|
|
||||||
</session>
|
</session>
|
||||||
|
|
||||||
<\session|maxima|default>
|
<\session|maxima|default>
|
||||||
|
@ -495,35 +514,37 @@
|
||||||
</output>
|
</output>
|
||||||
|
|
||||||
<\folded-io>
|
<\folded-io>
|
||||||
<with|color|red|(<with|math-font-family|rm|%i>1) >
|
<with|color|red|(<with|math-font-family|rm|%i>4) >
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
diff(<math|x+3>)
|
diff(<math|x+3>)
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
<math|<with|math-display|true|<text|<with|font-family|tt|color|red|(<with|math-font-family|rm|%o1>)
|
<math|<with|math-display|true|<text|<with|font-family|tt|color|red|(<with|math-font-family|rm|%o4>)
|
||||||
>>d*x>>
|
>>d*x>>
|
||||||
</folded-io>
|
</folded-io>
|
||||||
|
|
||||||
<\folded-io>
|
<\folded-io>
|
||||||
<with|color|red|(<with|math-font-family|rm|%i>2) >
|
<with|color|red|(<with|math-font-family|rm|%i>5) >
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
diff(<math|x*y>,x)
|
diff(<math|x*y>,x)
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
\;
|
<math|<with|math-display|true|<text|<with|font-family|tt|color|red|(<with|math-font-family|rm|%o5>)
|
||||||
|
|
||||||
\ <math|<with|math-display|true|<text|<with|font-family|tt|color|red|(<with|math-font-family|rm|%o2>)
|
|
||||||
>>y>>
|
>>y>>
|
||||||
</folded-io>
|
</folded-io>
|
||||||
|
|
||||||
<\folded-io>
|
<\folded-io>
|
||||||
<with|color|red|(<with|math-font-family|rm|%i>3) >
|
<with|color|red|(<with|math-font-family|rm|%i>6) >
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
diff(<math|x*y*<around*|(|x+3|)>>,x)
|
diff(<math|x*y*<around*|(|x+3|)>>,x)
|
||||||
<|folded-io>
|
<|folded-io>
|
||||||
\;
|
<math|<with|math-display|true|<text|<with|font-family|tt|color|red|(<with|math-font-family|rm|%o6>)
|
||||||
|
|
||||||
\ <math|<with|math-display|true|<text|<with|font-family|tt|color|red|(<with|math-font-family|rm|%o3>)
|
|
||||||
>><around*|(|x+3|)>*y+x*y>>
|
>><around*|(|x+3|)>*y+x*y>>
|
||||||
</folded-io>
|
</folded-io>
|
||||||
|
|
||||||
|
<\input>
|
||||||
|
<with|color|red|(<with|math-font-family|rm|%i>7) >
|
||||||
|
<|input>
|
||||||
|
\;
|
||||||
|
</input>
|
||||||
</session>
|
</session>
|
||||||
</slide>
|
</slide>
|
||||||
|
|
||||||
|
@ -531,9 +552,9 @@
|
||||||
<tit|\<#7B26\>\<#53F7\>\<#6C42\>\<#5BFC\>\V\<#5B9E\>\<#73B0\>>
|
<tit|\<#7B26\>\<#53F7\>\<#6C42\>\<#5BFC\>\V\<#5B9E\>\<#73B0\>>
|
||||||
|
|
||||||
<\session|s7|default>
|
<\session|s7|default>
|
||||||
<\folded-io>
|
<\unfolded-io>
|
||||||
\<gtr\>\
|
\<gtr\>\
|
||||||
<|folded-io>
|
<|unfolded-io>
|
||||||
(define (deriv exp var)
|
(define (deriv exp var)
|
||||||
|
|
||||||
\ \ (cond ((number? exp) 0)
|
\ \ (cond ((number? exp) 0)
|
||||||
|
@ -565,9 +586,9 @@
|
||||||
\ \ \ \ \ \ \ \ (else
|
\ \ \ \ \ \ \ \ (else
|
||||||
|
|
||||||
\ \ \ \ \ \ \ \ \ (error "unknown expression type -- DERIV" exp))))
|
\ \ \ \ \ \ \ \ \ (error "unknown expression type -- DERIV" exp))))
|
||||||
<|folded-io>
|
<|unfolded-io>
|
||||||
deriv
|
deriv
|
||||||
</folded-io>
|
</unfolded-io>
|
||||||
</session>
|
</session>
|
||||||
</slide>
|
</slide>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue