然后我可以对数组中的列表循环调用该函数,输出每个函数的值,就像它是一个数字一样。
I could then iterate over the functions in the list, printing out the values for each as they were applied to a particular number. For instance, if I wrote the following snippet.
我们所做的是,用一个循环遍历参数列表检查每个参数来看它是否为选项。
What we do is, in a loop, march down the argument list checking each one to see if it is an option.
它们只包含一个经过注释的命令列表,没有任何分支和循环。
They consist of nothing more than a commented list of commands with no branches or loops.
由于您无需等待一个列表生成完毕(停止并前进)或者分配一个线程用于处理循环(并行管道),这可能是最有效率的方法了。
Since you do not have to wait for a list to be generated (stop and go) or allocate a thread to processing the loop (pipelining), this can be the most efficient method.
这些脚本可能执行循环,也可能打开一张长的文件列表,忘记在打开新文件之前先关闭当前文件。
These scripts might execute a loop, or perhaps open a long list of files, forgetting to close the current file before opening a new one.
因此,垃圾收集器可以回收在每个循环上分配的大多数内存,但它不能回收添加到列表中的数组。
Thus the garbage collector can reclaim most of the memory allocated on each loop, but it can't reclaim the arrays that are added to the list.
我要创建一个列表,是的,你可以看到这里有一个小小的循环。
I'm going to build a list. Right, you can see that little loop going through there.
其中有一点微不足道的差别:现在将在一张列表内而不是在数组中循环,这将导致需要在循环控制中执行一些小更改。
One of the differences is trivial: You're now looping over a list rather than an array, which causes minor changes in the loop control.
如果条件的求值结果为TRUE,那么就将执行语句列表,在循环的顶部恢复控制。
If the condition evaluates to TRUE, the statement list is executed, then control resumes at the top of the loop.
该算法中的顶层循环对可能出现在XML文档中的xml元素和属性的列表进行迭代。
The top loop in the algorithm iterates over the list of XML elements and attributes that may appear in the XML document.
密匙对和安全组的列表在循环外部创建。
The lists of key pairs and security groups are created outside the loop.
这个简单函数创建了一个表格节点,然后循环访问书的列表并为每本书创建一行,为每个数据元素分配一个单元格。
This simple function creates a table node, then iterates through the book list and creates a row for each book, with a cell for each data element.
由于搜索结果可能有多项,循环遍历菜谱列表并输出其名称和说明。
Because the search can return multiple hits, I cycle around the list of recipes and output their names and descriptions.
循环处理联系人列表,把每个联系人的姓名、电话号码和电子邮件数据放进每行的前三列。
Iterates through the contact list, placing name, telephone, and E-mail data for each contact into the first three columns of each row.
模板中经常要使用循环格式化表格或者列表形式的信息。
Repetition is required frequently in templates to format information in a tabular or list format.
这对于单一对象实例不是什么大问题,但是循环遍历对象列表很容易导致执行大量查询。
This isn't much of an issue with single instances of objects, but iterating over lists of objects can easily cause a large number of queries to be executed.
然后,可以在一个foreach循环中使用这个列表,引用每个元素并把它添加到适当的span 中。
You can then use that list in a for each loop, referencing each one in turn and adding it to the appropriate span.
完成所有这些定义之后,接下来就是脚本的核心了:一个简单的for循环,用于处理文件列表中的各文件。
After all that comes the heart of the script: a simple for loop that processes each file in the files list.
一个表单列表的选项是在一个循环的{section}中生成的,如清单13所示。
The options of a form list are generated in a loop with {section}, as shown in Listing 13.
在代码中,我使用了一个不支持的列表,将其放入一个普通的for循环。
I used one unsupported list comprehension in my code, which I had to unroll into a regular for loop.
最后,所有行连接成现在的HTML,当for循环完成后,就有了完整列表。
Finally, the whole line is concatenated to the existing HTML so you have a complete list when the for loop is completed.
循环结束时,代码将拥有一个完全填充的Channel对象和一个完全填充的Item对象列表。
When the loop is finished, the code will have a fully populated Channel object and a list of fully populated Item objects.
for 循环在string列表上进行迭代,一次输出一行。
The for loop iterates over the list of strings, printing them out one at a time.
一旦有了与我们搜索的标准相匹配的企业清单,这个代码通过循环该列表并打印所有匹配的企业名称
Once we have the list of businesses that match our search criteria, this code iterates through the list and prints the names of all the businesses that match
循环或列表中的变量包括了列表或对象集合的所有元素。
A variable in a loop or list comprehension ranges over the elements of a list, or a collection of objects.
Encina连接器在网关列表(连接器的连接工厂的gatewayspec属性)中指定的网关之间循环来获取连接。
The Encina connector rotates among gateways specified in the gateway list (gatewaySpec property of the connection factory of the connector) to obtain connections.
因此,对于循环遍历标记列表中的单个级别,它已经足够了(除非我们正好寻找比特定标记产品级别低一级的级别,譬如“title”)。
Therefore, it suffices to loop across a single level in the tag list (except when we look exactly one level lower for the specific markup production, such as "title").
然后,该视图通过在列表中的每个列上进行循环,提供数据库中每一列的值。
Then, the view loops through each of these to provide the value of each column in the database.
注意,此版本甚至可以在循环自身中使用递归,两次调用循环本身,一次用于对列表左手边的内容进行排序,另一次对列表右手边的内容进行排序。
Notice that this version even makes use of recursiveness in itself, calling itself twice, once to sort the left-hand side of the list, and once again to sort the right-hand side of the list.
对条目的列表进行循环遍历,对于每个条目输出标题,然后是一个短暂的音频停顿。
For each item, you iterate over the list of items, and output the title, followed by a small audio pause.
应用推荐