What is the difference between map and apply in scheme?

前端 未结 3 2137
没有蜡笔的小新
没有蜡笔的小新 2021-02-07 06:26

I am trying to learn Scheme and I am having a hard time understanding the difference between map and apply.

As I understand, map a

3条回答
  •  温柔的废话
    2021-02-07 06:33

    As the top answer suggested, map

    The procedure will be called once for each position of the lists, using as arguments the list of elements at that position

    In contrast, apply

    (apply function argument-list)
    

    pass arguments in argument-list to function all at once. So function is called only once.

提交回复
热议问题