gpt4 book ai didi

erlang - 什么是列表 :zf/2 (Erlang)?

转载 作者:行者123 更新时间:2023-12-03 13:46:45 27 4
gpt4 key购买 nike

为什么 lists:zf/2 是 Erlang 中 filtermap/2 的别名?
这是列表中未记录但已导出的函数:模块。这是实现:

zf(F, L) ->
filtermap(F, L).
我感到困惑的是:
  • 这是为了什么?
  • “zf”代表什么? “策梅罗-弗兰克尔”?
  • 最佳答案

    正如 Erlang 的共同发明者 Robert Virding,wrote in 2016 :

    The lists:zf/2 function came before list comprehensions and is a combination of map and filter. Like describing a set from a set of rules. Hence the Zermelo-Fraenkel based name. It is also called lists:filtermap/2 but where’s the fun in that?


    所以,你的猜测是绝对正确的。

    关于erlang - 什么是列表 :zf/2 (Erlang)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64820523/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com