开发者

Origin of "map" in Computer Science

开发者 https://www.devze.com 2022-12-12 20:18 出处:网络
In computer science, there are two definitions of the word map. The first is as an associative array, a type of container that maps values of one type to values of another type. An example of this is

In computer science, there are two definitions of the word map. The first is as an associative array, a type of container that maps values of one type to values of another type. An example of this is the STL map. The second definition is from functional programming, in which map is a function that takes a list and a function, applies the function to all elements of the list in order, and returns a list of results.

What are the origins of the different definitions of map? I'm guessing that the second definition might have come from the map开发者_如何学运维car function from McCarthy LISP, but I'm not sure if that was derived from another useful. The first definition makes intuitive sense to me, but I'm not sure where it came from.


Both of these constructs define a map in the mathematical sense: a mapping of elements from one set to another.


Well, there's the mathematical meaning of map, which is a pairing of elements from one set to another.

0

精彩评论

暂无评论...
验证码 换一张
取 消