Difference between revisions of "Comments:Zip Command"
From GeoGebra Manual
m (r2.7.4) (robot Adding: nb:Zip Kommando) |
m (Text replace - "[[nb:" to "[[no:") |
||
Line 1: | Line 1: | ||
− | |||
− | |||
It's actually enough to provide a single list to Zip[]. This makes it a shorter alternative to Sequence[] when all you want is to traverse a list. For example, <code>Zip[a^2, a, listOfNumbers]</code> is much shorter than <code>Sequence[Element[listOfNumbers, a]^2, a, 1, Length[listOfNumbers]]</code> (albeit in this case it's easier to just do <code>listOfNumbers^2</code>.) | It's actually enough to provide a single list to Zip[]. This makes it a shorter alternative to Sequence[] when all you want is to traverse a list. For example, <code>Zip[a^2, a, listOfNumbers]</code> is much shorter than <code>Sequence[Element[listOfNumbers, a]^2, a, 1, Length[listOfNumbers]]</code> (albeit in this case it's easier to just do <code>listOfNumbers^2</code>.) | ||
− | |||
{{Hint|1=Zip[] is similar to a construct known as "map" in other programming languages.}} | {{Hint|1=Zip[] is similar to a construct known as "map" in other programming languages.}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 09:45, 17 May 2013
It's actually enough to provide a single list to Zip[]. This makes it a shorter alternative to Sequence[] when all you want is to traverse a list. For example, Zip[a^2, a, listOfNumbers]
is much shorter than Sequence[Element[listOfNumbers, a]^2, a, 1, Length[listOfNumbers]]
(albeit in this case it's easier to just do listOfNumbers^2
.)
Hint: Zip[] is similar to a construct known as "map" in other programming languages.