The only problem is that right now very few compilers implement tail-call optimizations.
惟一的问题在于,现在只有非常少的编译器实现了尾部调用优化。
For those who actually like to mess with the low-level stuff, here is an assembly language template for an optimized tail-call.
这里是为那些真正热衷底层编程的人准备的一个优化尾部调用的汇编语言模板。
The idea of removing stack frames after tail-calls is called tail-call optimization.
在尾部调用之后除去栈结构的方法称为尾部调用优化。
As you can see in order for the call to be a true tail-call, no other operation can be performed on the result of the tail-called function before it is passed back.
可见,要使调用成为真正的尾部调用,在尾部调用函数返回之前,对其结果不能执行任何其他操作。
The last call (the tail) simply invokes the function without any procedure call or stack maintenance overhead.
最后的调用(尾(tail))只是调用函数,没有任何过程调用或栈维护开销。
For example, the print_report_i function described earlier compiled with tail-call optimization using -O2 on GCC 3.4 and therefore runs with a stack-size that is constant, not growing linearly.
例如,前面描述的 print_report_i函数在GCC 3.4 中使用-O2 进行尾部调用优化编译,因此运行时使用的栈的大小是固定的,而不是线性增长的。
It IS a long tail, certainly, 'said Alice, looking down with wonder at the Mouse's tail;' but why do you call it sad?
爱丽丝没有听清这句话,她看着老鼠的尾巴纳闷了:“它确实是根长尾巴,可为什么说尾巴是悲伤的呢?”
"It is a long tail, certainly," said Alice, looking down with wonder at the Mouse 'tail, "but why do you call it sad?"
爱丽丝听了,瞧着那光滑的尾巴说:“你这尾巴是长呀!可是为什么又说它苦呢?”
Therefore, the small probability of extreme events of great value-the tail risks should call peoples' attention.
所以,对小概率大数值的极端尾部风险事件要引起人们的高度重视。
Therefore, the small probability of extreme events of great value-the tail risks should call peoples' attention.
所以,对小概率大数值的极端尾部风险事件要引起人们的高度重视。
应用推荐