forked from DeathKing/Learning-SICP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlec7a.srt
7001 lines (5599 loc) · 142 KB
/
lec7a.srt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1
00:00:00,030 --> 00:00:02,688
Learning-SICP学习小组
倾情制作
2
00:00:02,752 --> 00:00:05,968
翻译&&时间轴:邓雄飞、张大伟
压制&&特效:邓雄飞(Dysprosium)
校对:邓雄飞(Dysprosium)
3
00:00:06,000 --> 00:00:08,752
特别感谢:裘宗燕教授
4
00:00:08,848 --> 00:00:11,408
计算机程序的构造和解释
5
00:00:11,420 --> 00:00:13,248
元循环求值器 I
Metacircular Evaluator
6
00:00:15,792 --> 00:00:17,328
教授:今天我们将学习一些
PROFESSOR: Well today we're going to learn about something
7
00:00:17,520 --> 00:00:18,410
非同一般的东西
quite amazing.
8
00:00:19,200 --> 00:00:21,888
我们将对计算机程序
We're going to understand what we mean by a program
9
00:00:22,592 --> 00:00:25,216
有更深层次的理解
a little bit more profoundly than we have up till now.
10
00:00:26,800 --> 00:00:29,120
目前为止 我们一直把程序看作
Up till now, we've been thinking
11
00:00:29,264 --> 00:00:32,096
对机器的描述
programs as describing machines.
12
00:00:32,720 --> 00:00:37,216
举个例子 在这个幻灯片上
So for example, looking at this still store
13
00:00:37,936 --> 00:00:41,776
我们可以看到一个计算阶乘的程序
we see here is a program for factorial.
14
00:00:42,800 --> 00:00:47,312
当然 你可以认为这些字符串描述了
And what it is, is a character string description, if you will,
15
00:00:47,664 --> 00:00:51,984
这个线路图所表示的无穷机器
of the wiring diagram of a potentially infinite machine.
16
00:00:52,496 --> 00:00:54,800
我们可以稍稍地看下 它描述的是什么
And we can look at that a little bit and just see the idea.
17
00:00:55,130 --> 00:00:58,208
这种紧凑的记法 描述的是:
That this is a sort of compact notation which says,
18
00:00:58,544 --> 00:01:00,170
如果N是0 结果就是1
if n is 0, the result is one.
19
00:01:00,170 --> 00:01:02,000
N是从这里进入机器的
Well here comes n coming into this machine,
20
00:01:02,336 --> 00:01:03,520
如果它是0的话
and if it's 0,
21
00:01:03,744 --> 00:01:05,200
那么我就控制这个开关
then I control this switch
22
00:01:05,472 --> 00:01:08,208
把它掰到输出为1的那一端
in such a way that the switch allows the output to be one.
23
00:01:09,340 --> 00:01:10,080
否则的话
Otherwise,
24
00:01:10,384 --> 00:01:12,832
就是(* N (FACT (- N 1)))
it's n times factorial of n minus one.
25
00:01:12,970 --> 00:01:15,136
我先计算(FACT (- N 1))
Well, I'm computing factorial of n minus one
26
00:01:15,290 --> 00:01:16,688
再把结果乘以N
and multiplying that by n,
27
00:01:16,848 --> 00:01:18,912
这样如果N不为0的话
in the case that it's not 0,
28
00:01:18,912 --> 00:01:20,608
这个开关就会输出这里的结果
this switch makes the output come from there.
29
00:01:21,900 --> 00:01:22,320
当然了
Of course,
30
00:01:22,368 --> 00:01:25,130
这个机器可能有无穷多个部件
this is a machine with a potentially infinite number of parts,
31
00:01:25,488 --> 00:01:28,128
因为FACT内部又调用了FACT
because factorial occurs within factorial,
32
00:01:28,432 --> 00:01:30,176
因此我们不知道调用栈有多深
so we don't know how deep it has to be.
33
00:01:31,070 --> 00:01:33,552
但到目前为止
But that's basically what our notation
34
00:01:34,224 --> 00:01:37,696
代码对我们来说就是这样的东西了
for programs really means to us at this point.
35
00:01:38,310 --> 00:01:40,592
你可以认为代码是用字符串来描述
It's a character string description, if you will,
36
00:01:41,280 --> 00:01:44,160
某种用其它方式描画的线路图
of a wiring diagram that could also be drawn some other way.
37
00:01:44,900 --> 00:01:46,608
事实上 很多人都向我提议
And, in fact, many people have proposed to me,
38
00:01:46,848 --> 00:01:49,040
说程序设计语言应该像这个一样 是图像化的
programming languages look graphical like this.
39
00:01:49,490 --> 00:01:51,808
不过我不认为用图形表示会有很多优势
I'm not sure I believe there are many advantages.
40
00:01:52,000 --> 00:01:53,792
当然 最主要的劣势就是
The major disadvantage, of course,
41
00:01:53,808 --> 00:01:55,632
它需要占用很大的平面空间
is that it takes up more space on a page,
42
00:01:55,968 --> 00:01:59,952
所以展示和修改起来就非常麻烦
and, therefore, it's harder to pack into a listing or to edit very well.
43
00:02:01,344 --> 00:02:02,160
但是不管怎样
But in any case,
44
00:02:03,580 --> 00:02:05,152
在计算的世界中
there's something very remarkable
45
00:02:05,184 --> 00:02:07,050
还有一个非常重要的东西
that can happen in the computation world
46
00:02:07,648 --> 00:02:10,640
也就是所谓的“通用机器”
which is that you can have something called a universal machine.
47
00:02:10,730 --> 00:02:15,248
我们再来看第二张幻灯片
If we look at the second slide,
48
00:02:16,048 --> 00:02:17,184
我们看到的就是
what we see is
49
00:02:18,144 --> 00:02:19,888
名为EVAL的特殊机器
a special machine called eval.
50
00:02:21,260 --> 00:02:22,864
这个叫做EVAL的机器
There is a machine called eval,
51
00:02:22,880 --> 00:02:24,240
也就是我今天要讲解的
and I'm going to show it to you today.
52
00:02:25,824 --> 00:02:26,672
它非常简单
It's very simple.
53
00:02:27,780 --> 00:02:30,800
最了不起的是 它简单得可以写在黑板上
What is remarkable is that it will fit on the blackboard.
54
00:02:33,350 --> 00:02:35,792
然而 EVAL这个机器
However, eval is a machine
55
00:02:36,000 --> 00:02:39,840
是以其它机器的描述作为输入的
which takes as input a description of another machine.
56
00:02:40,450 --> 00:02:42,128
它可以接收一个
It could take the wiring diagram
57
00:02:42,400 --> 00:02:45,584
阶乘机器的线路图作为输入
of a factorial machine as input.
58
00:02:46,490 --> 00:02:47,664
这样一来
Having done so,
59
00:02:48,496 --> 00:02:52,570
它就可以模拟那台阶乘机器
it becomes a simulator for the factorial machine
60
00:02:53,136 --> 00:02:53,792
这样的话
such that,
61
00:02:54,160 --> 00:02:56,368
如果输入6 就会得到720
if you put a six in, out comes a 720.
62
00:02:58,910 --> 00:03:01,680
这是一个非常了不起的机器
That's a very remarkable sort of machine.
63
00:03:02,130 --> 00:03:03,584
而最让人惊奇的是
And the most amazing part of it
64
00:03:03,776 --> 00:03:05,136
它竟然可以写在一个黑板内
it is that it fits on a blackboard.
65
00:03:05,590 --> 00:03:06,656
与之相反的是
By contrast,
66
00:03:07,320 --> 00:03:10,448
我们可以想象一下模拟电子世界中的
one could imagine in the analog electronics world
67
00:03:11,552 --> 00:03:12,864
一台非常不同的机器
a very different machine.
68
00:03:14,576 --> 00:03:16,336
这台机器呢
a machine where, a machine
69
00:03:16,528 --> 00:03:18,816
某种意义上 同样也是“通用机器”
which also was, in some sense, universal,
70
00:03:19,260 --> 00:03:23,120
只要你输入一个电路图
where you gave a circuit diagram as one of the inputs,
71
00:03:23,824 --> 00:03:25,744
比如这个小型的低通滤波器
for example, of this little low-pass filter,
72
00:03:26,016 --> 00:03:27,488
单极低通滤波器之类的
one-pole low-pass filter.
73
00:03:28,050 --> 00:03:29,536
你可以想像
And you can imagine that
74
00:03:29,710 --> 00:03:33,152
如果我们扫描这个元件得到扫描线
you could, for example, scan this out-- the scan lines
75
00:03:34,432 --> 00:03:37,130
得到的信号描述的就是
Right? are the signal that's describing
76
00:03:37,392 --> 00:03:40,400
这个机器所模拟的
what this machine is to simulate--
77
00:03:40,784 --> 00:03:43,392
这个模拟机器EVAL是由电路构成
then the analog of eval which is made out of electrical circuits,
78
00:03:43,680 --> 00:03:45,152
它可以把自己配置成一个滤波器
which configure itself into a filter
79
00:03:45,184 --> 00:03:48,040
响应由电路图指定的频率
has the frequency response specified by the circuit diagram.
80
00:03:49,890 --> 00:03:51,488
这种机器很难制造出来
That's a very hard machine to make,
81
00:03:51,616 --> 00:03:54,064
当然 更不可能用一个黑板就把它说清楚
and, surely, there's no chance that I could put it on a blackboard.
82
00:03:55,670 --> 00:03:57,584
所以今天我们将学习一些神奇的东西
So we're going to see an amazing thing today.
83
00:03:58,430 --> 00:04:00,816
我们将在黑板上见证
We're going to see, on the blackboard,
84
00:04:01,168 --> 00:04:02,496
通用机器
the universal machine.
85
00:04:02,790 --> 00:04:04,416
跟其它程序比起来
And we'll see that among other things,
86
00:04:04,528 --> 00:04:05,808
它真是非常简单
it's extremely simple.
87
00:04:06,780 --> 00:04:08,752
现在 我们已经非常接近
Now, we're getting very close
88
00:04:09,088 --> 00:04:10,976
计算机中真正的精灵了
the real spirit in the computer at this point.
89
00:04:11,280 --> 00:04:14,624
所以为了保持足够的尊重
So I have to show a certain amount of reverence and respect,
90
00:04:15,184 --> 00:04:17,328
我特地穿上外套
so I'm going to wear a suit jacket for the only time
91
00:04:17,520 --> 00:04:19,296
你们应该从没见我穿过
that you'll ever see me wear a suit jacket here.
92
00:04:20,470 --> 00:04:22,736
在这个盛重的场合
And I think I'm also going to
93
00:04:23,552 --> 00:04:26,704
我还得戴上一顶合适的帽子
put on an appropriate hat for the occasion.
94
00:04:28,780 --> 00:04:31,440
开讲前再给大家提个醒
Now, this is a lecturer which I have to warn you--
95
00:04:34,140 --> 00:04:36,912
那些40岁以下
let's see, normally, people under 40
96
00:04:37,168 --> 00:04:38,490
以及没有孩子的人
and who don't have several children
97
00:04:38,672 --> 00:04:40,496
你们可要小心了
are advised to be careful.
98
00:04:40,490 --> 00:04:41,968
如果真的受不了 可以选择离开
If they're really worried, they should leave.
99
00:04:43,340 --> 00:04:45,568
因为一会儿要发生一些
Because there's a certain amount of
100
00:04:45,728 --> 00:04:47,130
非常神秘的事情
mysticism that will appear here
101
00:04:47,744 --> 00:04:51,056
可能使你的大脑异常混乱
which may be disturbing and cause trouble in your minds.
102
00:04:51,820 --> 00:04:54,288
好了 无论如何
Well in any case, let's see,
103
00:04:55,712 --> 00:05:01,104
我要带着你们写一个Lisp求值器
I wish to write for you the evaluator for Lisp.
104
00:05:02,510 --> 00:05:04,288
求值器并不复杂
Now the evaluator isn't very complicated.
105
00:05:05,020 --> 00:05:07,632
很像我们以前见到过的程序
It's very much like all the programs we've seen already.
106
00:05:08,240 --> 00:05:09,488
这也是它令人吃惊的地方
That's the amazing part of it.
107
00:05:10,860 --> 00:05:13,104
现在我开始写这个程序
It's going to be-- and I'm going to write it right here--
108
00:05:15,280 --> 00:05:16,620
我把这个程序叫做EVAL
it's a program called eval.
109
00:05:22,900 --> 00:05:26,240
这个过程接收两个参数
And it's a procedure of two arguments
110
00:05:26,280 --> 00:05:29,440
表达式EXP和环境ENV
expression and an environment.
111
00:05:31,860 --> 00:05:33,792
跟所有实用过程一样
And like every interesting procedure,
112
00:05:34,016 --> 00:05:35,136
它是个“按情况分析”语句
it's a case analysis.
113
00:05:40,460 --> 00:05:41,872
但是在我开始之前
But before I start on this,
114
00:05:42,528 --> 00:05:43,904
我还想你们注意一下
I want to tell you some things.
115
00:05:44,448 --> 00:05:46,064
我将要在黑板上写的程序
The program we're going to write on the blackboard
116
00:05:46,560 --> 00:05:50,240
非常丑陋、混乱、令人作呕
is ugly, dirty, disgusting,
117
00:05:50,944 --> 00:05:53,168
并不是一种专业的写法
not the way I would write this is a professional.
118
00:05:54,320 --> 00:05:56,576
它是用具体语法写就的
It is written with concrete syntax,
119
00:05:57,248 --> 00:05:58,832
也就是说用了很多CAR、CDR
meaning you've got really to use lots of CARs and CDRs
120
00:05:58,848 --> 00:06:00,624
我之前告诉过你们这样写并不好
which is exactly what I told you not to do.
121
00:06:02,944 --> 00:06:05,616
在这里是故意这样来写的
That's on purpose in this case,
122
00:06:06,110 --> 00:06:09,024
因为我想让它尽量精简
because I want it to be small, compact,
123
00:06:09,344 --> 00:06:10,400
能塞在黑板内
fit on the blackboard
124
00:06:10,432 --> 00:06:11,856
你们就可以看到整个代码
so you can get the whole thing.
125
00:06:12,420 --> 00:06:14,800
我就不像平时那样实用长变量名了
So I don't want to use long names like I normally use.
126
00:06:15,600 --> 00:06:17,296
就用CAR、CDR 因为它们短小
I want to use CAR-CDR because it's short.
127
00:06:18,060 --> 00:06:20,784
这算是一种取舍
Okay, I wanna, it's a whole, that's a trade-off.
128
00:06:20,896 --> 00:06:22,816
我不希望你们这样来写程序
I don't want you writing programs like this.
129
00:06:23,570 --> 00:06:25,088
这里单纯地想达到一种简洁的效果
This is purely for an effect.
130
00:06:25,850 --> 00:06:27,616
因此你们读起来可能有些费力
Now, you're going to have to work a little harder to read it,
131
00:06:27,776 --> 00:06:30,192
我尽量写得清楚一些
but I'm going to try to make it clear as I'm writing it.
132
00:06:31,270 --> 00:06:34,400
这个解释器已经比较完整了
I'm also-- this is a pretty much complete interpreter,
133
00:06:34,512 --> 00:06:36,240
但是还是缺少一些功能
but there's going to be room for putting in more things--
134
00:06:36,256 --> 00:06:38,608
我就不写定义和赋值的部分了
I'm going to leave out definition and assignment,
135
00:06:39,104 --> 00:06:42,416
因为它们都不是最本质的
just because they are not essential,
136
00:06:42,880 --> 00:06:46,464
稍后我就会解释 这是数学上的原因
and a, for a mathematical reason I'll show you later
137
00:06:46,928 --> 00:06:49,968
当然啦 黑板也没有那么大
and also they take up more space.
138
00:06:51,888 --> 00:06:53,648
但是 我们怎么做呢?
But, in any case, what do we have to do?
139
00:06:53,952 --> 00:06:55,664
我们需要一个分派
We have to do a dispatch
140
00:06:56,096 --> 00:06:57,904
它根据表达式的类型
which breaks the types of expressions up
141
00:06:58,288 --> 00:07:00,384
把它们划分为几类
into particular classes.
142
00:07:01,728 --> 00:07:03,264
这就是现在要做的
Okay? So that's what we're going to have here.
143
00:07:03,824 --> 00:07:05,150
我们都有哪些表达式?
Well, what expressions are there?
144
00:07:05,150 --> 00:07:06,368
我们先来看几种表达式
Let's look at the kinds of expressions.
145
00:07:06,810 --> 00:07:09,600
比如说 数字“3”就是一个表达式
We can have things like the numeral three.
146
00:07:10,420 --> 00:07:11,584
我想让它代表什么呢?
What do I want that to do?
147
00:07:12,720 --> 00:07:14,752
我有很多选择 但是就现在而言
I can make choices, but I think right now,
148
00:07:15,056 --> 00:07:16,208
我就想让它表示数字3
I want it to be a three.
149
00:07:17,050 --> 00:07:17,888
这就是我要的
That's what I want.
150
00:07:18,720 --> 00:07:19,696
这个足够简单
So that's easy enough.
151
00:07:20,032 --> 00:07:22,912
那就意味着 如果表达式是数字
That means I want, if the thing is a number,
152
00:07:27,290 --> 00:07:31,680
表达式本身就应该是求值结果
that I want the expression itself as the answer.
153
00:07:35,420 --> 00:07:36,768
另外一种情况是
Now the next possibility
154
00:07:36,896 --> 00:07:38,864
表达式还可能是符号
is things that we represent as symbols.
155
00:07:39,390 --> 00:07:46,752
比如EXP、ENV、EVAL、NUMBER、X之类
Examples of symbols are things like x, n, eval, number, x.
156
00:07:48,016 --> 00:07:49,184
它们意味着什么?
What do I mean them to be?
157
00:07:50,160 --> 00:07:51,632
它们是一类代表其它事物的事物
Those are things that stand for other things.
158
00:07:51,632 --> 00:07:53,232
也就是我们语言中所谓的变量
Those are the variables of our language.
159
00:07:54,770 --> 00:07:56,880
因此我想要能够 比如说
And so I want to be able to say, for example,
160
00:07:57,056 --> 00:08:01,040
对X求值 可能会得到3
that x, for example, transforms to it's value which might be three.
161
00:08:02,640 --> 00:08:05,760
又可能是CAR
Or I might ask something like car.
162
00:08:07,760 --> 00:08:09,408
我希望它的值是
I want to have as its value--
163
00:08:09,632 --> 00:08:11,344
某种类似于过程的东西
be something like some procedure,
164
00:08:16,512 --> 00:08:18,432
我不需要知道它内部是什么
which I don't know what is inside there,
165
00:08:18,640 --> 00:08:21,152
可能是一些机器码 或者类似的东西
perhaps a machine language code or something like that.
166
00:08:22,848 --> 00:08:24,272
到这是还是相对简单的
Ok? So, well, that's easy enough.
167
00:08:24,430 --> 00:08:26,896
我想把这部分交给其他人来写
I'm going to push that off on someone else.
168
00:08:27,808 --> 00:08:28,896
如果我们有一个符号
If something is a symbol,
169
00:08:30,800 --> 00:08:32,480
假如表达式是符号
if the expression is a symbol,
170
00:08:33,424 --> 00:08:34,880
那么我求值它的结果就应该是
then I want the answer to be the result,
171
00:08:34,912 --> 00:08:40,240
在环境ENV中查找该表达式的值
looking up the expression in the environment.
172
00:08:46,480 --> 00:08:48,992
环境是一个字典
Now the environment is a dictionary
173
00:08:49,968 --> 00:08:54,060
它把符号映射成一个值
which maps the symbol names to their values.
174
00:08:54,288 --> 00:08:55,168
就这么简单
And that's all it is.
175
00:08:56,280 --> 00:08:57,200
怎么完成的呢?
How it's done?
176
00:08:57,530 --> 00:08:58,528
稍后我们再谈这个
Well, we'll see that later.
177
00:08:59,680 --> 00:09:00,576
其实并不难
It's very easy.
178
00:09:01,670 --> 00:09:04,288
编写类似于表的数据结构非常容易
It's easy to make data structures that are tables of various sorts.
179
00:09:04,840 --> 00:09:05,744
但它只是一个表
But it's only a table,
180
00:09:05,776 --> 00:09:07,560
而这是存取某个表的过程
and this is the access routine for some table.
181
00:09:09,550 --> 00:09:10,816
好的 接下来
Ok? Well, the next thing,
182
00:09:11,312 --> 00:09:12,560
另一类表达式
another kind of expression--
183
00:09:12,672 --> 00:09:15,568
表达式可能是一些不是数字的常量
you have things that are described constants that are not numbers,
184
00:09:16,064 --> 00:09:17,430
比如 'FOO
like 'foo.
185
00:09:20,170 --> 00:09:21,296
为了方便起见
Well, for my convenience,
186
00:09:21,312 --> 00:09:23,360
我想在语法上
I want to syntactically transform that
187
00:09:24,736 --> 00:09:26,800
把它转换成表结构
into a list structure which is,
188
00:09:26,848 --> 00:09:31,520
比如说是(QUOTE FOO)
which is, quote foo.
189
00:09:33,728 --> 00:09:37,180
一个被引用起来的对象 无论它是什么
Or it's -- A quoted object, whatever it is,
190
00:09:38,352 --> 00:09:40,832
都实际上是一个缩写
is going to be actually an abbreviation,
191
00:09:41,040 --> 00:09:42,592
这一部分并不由求值器负责
which is not part of the evaluator
192
00:09:43,216 --> 00:09:44,464
这是在其它地方完成的
but happens somewhere else,
193
00:09:44,752 --> 00:09:47,792
左边的符号就是右边表达式的缩略形式
an abbreviation for an expression that looks like this.
194
00:09:48,780 --> 00:09:50,480
这样 我就可以
This way, I can test for
195
00:09:50,576 --> 00:09:53,120
依据表达式的CAR部分
the type of the expression as being a quotation
196
00:09:53,312 --> 00:09:55,952
来判断它的类型了
by examining the car of the expression.
197
00:09:58,460 --> 00:10:01,088
因此这一部分也不会出现在求值器中
So I'm not going to worry about that in the evaluator.
198
00:10:01,650 --> 00:10:02,688
这在更早时候
It's happening somewhere earlier
199
00:10:02,700 --> 00:10:03,968
比如源代码读取阶段完成
in the reader or something.
200
00:10:05,540 --> 00:10:15,040
如果是引用表达式
If the expression of the expression is quote,
201