相似的问题还包括过多的递归。
请注意传统的递归首字母缩写。
请注意broker是尾递归的。
我使用目录技术来处理这种递归引用。
I use a directory approach to handle these recursive references.
这就是一个绝妙的递归定义。
另一个重要的概念是递归。
可见,递归函数与循环有很多类似之处。
As you can see, recursive functions and loops have quite a bit in common.
递归方法也需要显式的返回类型。
接下来,创建递归函数。
递归的另一个实例如下。
如果你还不明白什么是递归,就读这个句子。
If you still don't know what recursion is, read this sentence.
使用归纳数据编写递归过程非常简单。
With inductive data, it is fairly easy to write recursive procedures.
更严重的问题是类定义中可能存在多态递归。
The more serious problem is the potential for polymorphic recursion in class definitions.
将一个常见的循环转化为递归函数。
这是递归的停止条件。
递归通用表表达式 (RCTE)
例如,考虑在一个递归方法中会发生的事情。
Consider what would happen with a recursive method, for instance.
要了解其中的递归逻辑,请参阅存档的源文件。
To understand this recursive logic, check out the documented source file.
对更复杂的递归过程来说这是一个通用的模式。
This is a common pattern for more complex recursive procedures.
这就是我们使用递归的原因。
可以证明,这种递归解法需要耗费指数级的时间。
It can be shown that this recursive solution takes exponential time to run.
如果使用子程序的话,它不能是递归的。
以计算机术语表述,这条规则也可以称作递归树下行。
In computer terms, this rule is also known as recursive tree descent.
所以我们递归处理列表其余部分,并再次尝试。
我们的下一个基于列表的递归函数示例要稍微复杂一些。
Our next example of a recursive function on lists will be a little more complicated.
在某些情况下,您可以递归地使用首选数据源模式。
In some situations, you can use the Preferred Data Source Pattern recursively.
问题在于,我们能否在不使用递归的前提下实现访问者模式?
The question is, can we implement the Visitor pattern without recursion?
使用first和rest 组合实现递归效果很好。
The combination of first and rest works well with recursion.
第一个if 语句在列表为空的情况下中断递归,返回零值。
The first if statement breaks the recursion if the list is empty, returning zero.
但是t被递归地传递给count,和前面的示例一样。
But t is recursively passed to count again, just as with the earlier example.
应用推荐