1
0
Fork 0
This commit is contained in:
Darcy Shen 2024-01-31 17:12:22 +08:00
parent 77b673e4d2
commit 79dd25722d
1 changed files with 108 additions and 4 deletions

View File

@ -3,6 +3,10 @@
<style|<tuple|beamer|no-page-numbers|chinese>>
<\body>
<\hide-preamble>
<assign|dfn|<macro|x|<strong|<arg|x>>>>
</hide-preamble>
<\slideshow>
<\slide>
<tit|\<#96F6\>\<#57FA\>\<#7840\>SICP\<#FF1A\>\<#7B2C\>1\<#8BFE\>>
@ -90,8 +94,9 @@
\
REPL\<#FF1A\>Read Eval Print Loop \<#8BFB\>\<#53D6\>\<rightarrow\>\<#6C42\>\<#503C\>\<rightarrow\>\<#6253\>\<#5370\>\<rightarrow\>\<#5FAA\>\<#73AF\>
\<#FF08\>\<#4E3B\>\<#4F53\>\<#FF1A\>\<#89E3\>\<#91CA\>\<#5668\>\<#FF09\>
REPL\<#FF1A\><verbatim|Read-Eval-Print> Loop
\<#8BFB\>\<#53D6\>\<rightarrow\>\<#6C42\>\<#503C\>\<rightarrow\>\<#6253\>\<#5370\>
\<#5FAA\>\<#73AF\> \<#FF08\>\<#4E3B\>\<#4F53\>\<#FF1A\>Scheme\<#89E3\>\<#91CA\>\<#5668\>\<#FF09\>
<\session|scheme|default>
<\folded-io|Scheme] >
@ -127,13 +132,111 @@
<\slide>
<tit|\<#547D\>\<#540D\>\<#4E0E\>\<#73AF\>\<#5883\>>
\;
<\session|scheme|default>
<\folded-io|Scheme] >
(define pi 3.14159)
<|folded-io>
<errput|define: pi is immutable>
</folded-io>
<\folded-io|Scheme] >
(define \<#534A\>\<#5F84\> 1)
<|folded-io>
1
</folded-io>
<\folded-io|Scheme] >
(* pi (* \<#534A\>\<#5F84\> \<#534A\>\<#5F84\>))\
<|folded-io>
3.141592653589793
</folded-io>
<\folded-io|Scheme] >
(define \<#5468\>\<#957F\> (* 2 (* pi \<#534A\>\<#5F84\>)))
<|folded-io>
6.283185307179586
</folded-io>
<\folded-io|Scheme] >
\<#5468\>\<#957F\>
<|folded-io>
6.283185307179586
</folded-io>
<\input|Scheme] >
\;
</input>
</session>
</slide>
<\slide>
<tit|\<#7EC4\>\<#5408\>\<#5F0F\>\<#7684\>\<#6C42\>\<#503C\>>
\;
<\render-code>
\<#5BF9\>\<#7EC4\>\<#5408\>\<#5F0F\>\<#6C42\>\<#503C\>\<#FF08\>\<#9012\>\<#5F52\>\<#FF09\>
\<#7B2C\>\<#4E00\>\<#6B65\>\<#FF1A\>\<#5BF9\>\<#7EC4\>\<#5408\>\<#5F0F\>\<#7684\>\<#5B50\>\<#8868\>\<#8FBE\>\<#5F0F\>\<#6C42\>\<#503C\>
\<#7B2C\>\<#4E8C\>\<#6B65\>\<#FF1A\>\<#5BF9\>\<#53C2\>\<#6570\>\<#5E94\>\<#7528\>\<#8FC7\>\<#7A0B\>
</render-code>
<\with|par-columns|2>
<\session|scheme|default>
<\input|Scheme] >
(* (+ 2 (* 4 6))
\ \ \ (+ 3 5 7)) ; \<#7EC4\>\<#5408\>\<#5F0F\>
</input>
<\input|Scheme] >
(* <with|color|red|(+ 2 (* 4 6))>
\ \ \ (+ 3 5 7))
</input>
<\folded-io|Scheme] >
(* (+ 2 <with|color|red|(* 4 6)>)
\ \ \ (+ 3 5 7))
<|folded-io>
390
</folded-io>
<\input|Scheme] >
(* (+ 2 24)
\ \ \ (+ 3 5 7))
</input>
<\input|Scheme] >
(* <with|color|red|(+ 2 24)>
\ \ \ (+ 3 5 7))
</input>
<\input|Scheme] >
(* 26
\ \ \ (+ 3 5 7))
</input>
<\input|Scheme] >
(* 26
\ \ \ <with|color|red|(+ 3 5 7)>)
</input>
<\input|Scheme] >
(* 26 15) ; \<#7B2C\>\<#4E00\>\<#6B65\>\<#5DF2\>\<#5B8C\>\<#6210\>
</input>
<\input|Scheme] >
390 ; \<#7B2C\>\<#4E8C\>\<#6B65\>\<#5DF2\>\<#5B8C\>\<#6210\>
</input>
</session>
</with>
<tree|390|*|<tree|26|+|2|<tree|24|*|4|6>>|<tree|15|+|3|5|7>>
</slide>
<\slide>
@ -170,6 +273,7 @@
<\initial>
<\collection>
<associate|marked-color|pastel yellow>
<associate|page-border|attached>
<associate|page-medium|paper>
<associate|page-offset|1>