-
Notifications
You must be signed in to change notification settings - Fork 142
Eachpair
kevinlawler edited this page Jun 30, 2011
·
4 revisions
The eachpair adverb ':
applies its verb to each adjacent pair of elements in the argument.
-': 1 3 7 15 /minus each pair, or "deltas" 2 4 8 -': 100 10 1 -90 -9 %': 1 10 1000 1e6 /divide each pair, or "ratios" 10 100 1000.0 2.0 %': 1 10 1000 1e6 /left argument prepends 2 10 100 1000.0
This works much as you would expect, though note that eachpair reverses the order of the arguments it passes to the verb or function.
{x-y}': 1 3 7 15 2 4 8 {y-x}': 1 3 7 15 -2 -4 -8