Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Origin of "map" in Computer Science

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 mapcar 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.

like image 555
James Thompson Avatar asked Dec 01 '09 20:12

James Thompson


People also ask

What is map in computer science?

In many programming languages, map is the name of a higher-order function that applies a given function to each element of a collection, e.g. a list or set, returning the results in a collection of the same type. It is often called apply-to-all when considered in functional form.

What is the full meaning of map?

(mæp ) noun. 1. a diagrammatic representation of the earth's surface or part of it, showing the geographical distributions, positions, etc, of natural or artificial features such as roads, towns, relief, rainfall, etc.

Why is it called mapping?

The word "map" comes from the medieval Latin: Mappa mundi, wherein mappa meant 'napkin' or 'cloth' and mundi 'the world'. Thus, "map" became a shortened term referring to a two-dimensional representation of the surface of the world.

Is a map a data structure?

Maps (also known as Dictionaries) are data structures stores a collection of key-value pairs. Each key is unique and allows for quick access to values. A real life example of a map could be storing the grades for students in a class (student name is key, grade is value).


2 Answers

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

like image 90
glebm Avatar answered Oct 18 '22 15:10

glebm


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

like image 31
David R Tribble Avatar answered Oct 18 '22 14:10

David R Tribble