http://qs321.pair.com?node_id=1066670


in reply to Want for a name?

friends, neighbors, (over)laps

DB<106> sub friends (&@){ my $code=shift; $last=$_; my @result; for (@_) { push @result, $code->($last,$_); $last=$_; } return @result; } DB<107> friends { $_[0]+$_[1] } 1..5 => (1, 3, 5, 7, 9)

update
maybe "friendwise" in analogy to "pairwise" since "friend" is a noun

Cheers Rolf

( addicted to the Perl Programming Language)