Convolution (computer Science) - Language Comparison

Language Comparison

List of languages by support of convolution:

Zip in various languages
Language Zip Zip 3 lists Zip n lists Notes
Clojure (map list list1 list2)
(map vector list1 list2)
(map vector list1 list2 list3)
(map vector list1 list2 list3)
(map list list1 … listn)
(map vector list1 … listn)
Stops after the length of the shortest list.
Common Lisp (mapcar #'list list1 list2) (mapcar #'list list1 list2 list3) (mapcar #'list list1 ... listn) Stops after the length of the shortest list.
Haskell zip list1 list2 zip3 list1 list2 list3 zipn list1 … listn zipn for n > 3 is available in the module Data.List. Stops after the shortest list ends.
Python zip(list1, list2) zip(list1, list2, list3) zip(list1, …, listn) zip and map (3.x) stops after the shortest list ends, whereas map (2.x) and itertools.zip_longest (3.x) extends the shorter lists with None items
Unzip in various languages
Language Unzip Unzip 3 tuples Unzip n tuples Notes
Clojure (apply map vector convlist) (apply map vector convlist) (apply map vector convlist)
Common Lisp (apply #'mapcar #'list convlist) (apply #'mapcar #'list convlist) (apply #'mapcar #'list convlist)
Haskell unzip convlist unzip3 convlist unzipn convlist unzipn for n > 3 is available in the module Data.List.
Python zip(*convvlist) zip(*convvlist) zip(*convvlist)

Read more about this topic:  Convolution (computer Science)

Famous quotes containing the words language and/or comparison:

    “Our language has wisely sensed these two sides of man’s being alone. It has created the word “loneliness” to express the pain of being alone. And it has created the word “solitude” to express the glory of being alone. Although, in daily life, we do not always distinguish these words, we should do so consistently and thus deepen our understanding of our human predicament.”
    —Paul Tillich (1886–1965)

    “In comparison to the French Revolution, the American Revolution has come to seem a parochial and rather dull event. This, despite the fact that the American Revolution was successful—realizing the purposes of the revolutionaries and establishing a durable political regime—while the French Revolution was a resounding failure, devouring its own children and leading to an imperial despotism, followed by an eventual restoration of the monarchy.”
    —Irving Kristol (b. 1920)