Erlang Fun是收集垃圾吗?
如果一个人在Erlang中生成有趣的
,是否收集了垃圾?例如,要复制python,例如迭代器
或读取流,一个人可能会为每个收益率生成fun
s,这可能是很多。使用后不再需要使用过的fun
s,因此最终收集了垃圾吗?
我想那就是说,是一个对象,例如#fun< erl_eval.xx.yyyyyyyyyyyy>
a atom吗?
If one generates funs
in erlang, are they garbage collected? For instance to replicate a python like iterator
or to read a stream, one may generate fun
s for every yield -- potentially a great many. The used fun
s are no longer required after use, so are they eventually garbage collected?
I guess that is to say, is such an object as #Fun<erl_eval.xx.yyyyyyy>
an atom?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,有趣的不是原子,而是一个乐趣是其自己的数据类型。在某个时候,您会在文档中看到以下Erlang数据类型的顺序:
这意味着您可以写下这样的内容:
No, a fun is not an atom, rather a fun is its own data type. At some point, you will see the following ordering of erlang's data types in the docs:
which means you can write things like this: