• It ultimately evaluates that line of code but just once the stuff inside the curly braces, but the semicolon on the end, essentially has the effect of this.

    它最终执行了那行代码,但是只有一次,当那个东西在花括号里,分号放在后面,本质上影响了这个循环。

    哈佛公开课 - 计算机科学课程节选

  • So again immediately on first glance, a little more arcane, there are some distracting details, these curly braces, the semicolon, the quotation marks.

    第一眼扫过去,是不是有点神秘,有点繁琐,还有一些莫名其妙的大括号,分号和引号呢。

    哈佛公开课 - 计算机科学课程节选

  • Right. So similarly, if you've got one line of code with a semicolon at the end saying, this is the end of the statement, it doesn't really make sense to continue that conversation to try to continue conceptually that puzzle piece with curly braces.

    对的,类似的,如果你得到了一行代码,后面有一个分号,标志语句的结尾,这就没有意义来继续,那个会话来尝试对那段代码,使用花括号。

    哈佛公开课 - 计算机科学课程节选

  • Case in point: there's no semicolon here, there's no semicolon here, there's no semicolon here.

    恰当的例子:这里没有分号,这里也没有分号,这里也没有。

    哈佛公开课 - 计算机科学课程节选

  • But what does the -- what is the effect of that semicolon would you conjecture?

    但是你们推测,这个分号有什么影响?

    哈佛公开课 - 计算机科学课程节选

  • And, in fact, it kind of looks like a function, and yet here's a semicolon I just said that can get you into trouble, and yet that's not actually a function, because there's no interesting lines of code, because it turns out the interesting code is down here at the bottom.

    实际上,它有点像一个函数,并且这里有一个能够使你陷入麻烦当中的分号,那个事实上也不是一个函数,因为这里没有有用的代码,因为,有用的代码都在底端。

    哈佛公开课 - 计算机科学课程节选

  • In every example thus far we've had a semicolon saying that's our initialization.

    在每个例子中,有我们有一个分号来指明,那是我们的初始化。

    哈佛公开课 - 计算机科学课程节选

  • J++ Now here's the semicolon, J less than N, where N is this, J plus, plus; so what am I doing?

    现在这里是一个分号,J小于N,N是这个,那么我在做什么?

    哈佛公开课 - 计算机科学课程节选

  • So it's these little differences that you'll very quickly acclimate to but it's these stupid little syntactic details that trips off, especially those less comfortable early on because if you leave out a single character, namely that semicolon on the right hand side, nothing will work.

    你会很快适应这些,微小的区别,但我们正是要把这些罗里吧嗦的语法细节,尤其是那些让人非常头大的句子啃下来才行,因为如果我们一旦遗漏掉某个符号,譬如一个分号,从另一方面看来,很有可能什么都工作不了。

    哈佛公开课 - 计算机科学课程节选

  • The semicolon separates each of the parts.

    每个部分用冒号隔开。

    哈佛公开课 - 计算机科学课程节选

  • The semicolon just separates this from the rest.

    其中的分号只是用来间隔两条语句。

    哈佛公开课 - 计算机科学课程节选

  • But a semicolon thereafter is sufficient.

    但是其后的分号是足够的。

    哈佛公开课 - 计算机科学课程节选

  • So it's definitely the semicolon.

    它当然是一个分号。

    哈佛公开课 - 计算机科学课程节选

  • So really, the rule of thumb if you think back to Scratch is -- that any time you write a statement -- -- something that does something in one line of code -- you generally need the semicolon there.

    实际上,根据经验,你们回忆一下在Scratch中,任何时候你们写一条语句-,处理一些操作的一行代码-,你们通常需要在那里加个分号。

    哈佛公开课 - 计算机科学课程节选

  • I'm going to call it int *y enter or, sorry, semicolon, and then what if I do this?

    我把它叫做int,*y,回车,抱歉,分号,如果我这样处理,会发生什么?

    哈佛公开课 - 计算机科学课程节选

  • For some reason I had this backslash N, a close quote, parenthesis, semicolon, close curly brace.

    由于某些必要原因,我们还得加上\n,后引号,圆括号,分号,后大括号。

    哈佛公开课 - 计算机科学课程节选

  • So in other words, if you terminate these lines early, if you terminate the four loop early, if you terminate an if condition early with that semicolon, the code may very well work; and this is a common source -- of frustration and conundrum because you don't -- because your code looks right and yet it's misbehaving, but that semicolon means stop looking for subsequent lines of related code.

    换句话说,如果你用分号过早的终止了这些代码行,如果你过早地终止了那个for循环,如果如此,一个if条件,代码可能可以运行,这就是,挫折和问题产生的源头,因为你没有-,因为你的代码看起来是正确的,但是运行是错误的,那个分号的意思是,停止寻找后面相关的代码。

    哈佛公开课 - 计算机科学课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定