Go语言的递归函数调用是否进行了尾递归优化?

huangapple go评论84阅读模式
英文:

Is Go recursive function call tail-optimized?

问题

请问您需要翻译的内容是:

查看:https://gobyexample.com/recursion

像 Erlang 这样的一些语言具有尾递归优化(TCO)。Go 语言也是这样吗?

具体来说,我指的是这里提供的主要(目前流行的)编译器:http://golang.org/doc/install

英文:

See: https://gobyexample.com/recursion

Some languages like Erlang have TCO. Is it the case with Go as well?

Specifically, I mean the main (popular for now) compiler available here: http://golang.org/doc/install

答案1

得分: 4

尾调用优化

对于 gc(6g、5g、8g)来说,目前没有这样的计划。

我认为语言很不可能需要这个。

Russ

如果这种情况发生变化,将会在《Go 发布历史》中进行记录。

英文:

> Tail call optimization
>
> There are no such plans for gc (6g, 5g, 8g).
>
> I think it's very unlikely that the language would require it.
>
> Russ

In the unlikely event that this changes, it will be documented in the Go Release History.

huangapple
  • 本文由 发表于 2014年3月1日 06:14:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/22106855.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定