Alright, so maybe a little underwhelming and we saw already what this program is going to do but let's just go through this process once before we start doing more interesting things and then we'll come back and at least give you a hint of what some of these syntactic details are doing.
好吧,这个程序也许太平庸了,让人印象不够深刻,我们也知道这个程序是干嘛的,在我们开始更有意思的事情之前,让我们再来讨论一下整个过程后再回来,这些语法细节到底是在做什么呢?,先给你们一点小小的提示。
Computing square root. I'm going to capture it in a piece of code, I'm going to be able to refer to it by a name, and I'm going to suppress the details, meaning inside of that computation, you don't need to know what it does. You just need to know, if I give it the right kind of input, it'll give me back an input that satisfies the contract that I set up.
比如计算平方根,我会用一段代码来说明,我将给它命名,并且忽略细节,意思就是在这一段计算过程中,你不用知道它做了什么,你只需知道,如果我进行了正确的输入,它将会给我符合条件的输出。
应用推荐