"I learned you can heat chicken feathers and use it as hydrogren to replace gas in your car."
VOA: standard.2010.04.25
My prototype, again, so that I can use it later increment without the compiler wondering what is this increment that you're referring to because it's not otherwise been declared.
我的函数原型,再次强调,我可以以后使用它,这样编译器就不会疑惑这个你提及的,是什么,因为是没有,被声明的。
so you can, yeah, you can use it to go around the park, or you can use it to get from place to place, I think.
所以,你能用它去公园转,或者你可以用它从一个地方去另一个地方。
And the reason is, and this will come up on the problems and a lot of students end up using this equation, which is why I want to head it off and mention it ahead of time, we can't use an equation because this equation is very specific for light.
原因是,很多同学在解题时,都会用这个方程,所以我要,事先提醒你们一下,我们不能用这个方程,因为它只对光是用。
And the idea behind recursion I'm going to describe with a simple example. And then I'm going to show you how we can actually use it.
但是为了解释递归的意义,我想举个简单的例子,我将会给你们展示我们该如何使用它。
The "I have" pattern is very simple but it's great. Because you can use it to show so many things.
I have”句型非常简单但却非常好用。你可以用它来表示大大小小各种情况。
Or you can use it to express something that you've been pondering,
I think”句型也可以用来表示一些你在思考的事情,
OK. The other piece I want to say about variable names is, once I have that choice of variable name, I can use it, but in fact there are a few things that I can't use in terms of variable names.
关于变量名字我还想说的,另外一点就是,一旦我对变量的名称可以选择,我可以用自己的方式命名,但是,有一些词汇是,不能用来命名变量的。
Now that I've written sqrt, I can just use it anywhere I want in the code. You've got to rely on the fact that I wrote it correctly, but you can basically suppress the details of how it's used.
就是忽略细节,既然我已经编写了sqrt函数,我可以在代码的任何地方使用它,你完全可以依靠,我已经编写的这个函数。
I said, use the name mystring to be bound to or have the value of Eric, so I can refer to it anywhere else that I want to use it.
用mystring这个名字,来绑定Eric这个值,这样我就能,在任何想用这个值的地方使用它了。
I don't have to go read what it printed out in the screen. This has returned a value that I can use. Because I could do a test to say, is this a return value? If it's not, I'll do something else with it. So the binding is still there, it simply doesn't print it out.
我不想读到屏幕中打印出来的这行字,程序返回过一个我能够使用的值,因为我可以做个小测试,来说明这是否是返回的值,如果不是,我可以做一些其它的事,而这个绑定依然在这儿,没有打印任何东西。
What is this? This is a wonderful piece of abstraction. It is saying, you don't need to know squat about what's inside the body of this function. You don't have to worry about the parameter names, because they're going to be preserved, you don't need to worry about how I'm doing it, this tells you how you can use this, in order to use it correctly. Of course, I can then close it off, and off we go.
但是这能告诉你一些信息,这是什么?,这是一段完美的抽象,它的意思是你不需要知道,这个函数的内部构造,你不必担心参数是否重名,因为它们已经被预存了,你不需要担心我如何使用它,它告诉了你你该如何操作,从而正确的使用它,当然我也可以把它关掉。
应用推荐