Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Want for a name?

by Corion (Patriarch)
on Dec 11, 2013 at 08:45 UTC ( [id://1066565] : note . print w/replies, xml ) Need Help??


in reply to Want for a name?

I'm bad at naming things, so bear with me.

I would consider pairwise, but that is already used, and it also does not describe your subroutine, as it does not pair things, but takes the right neighbour of every element.

Likely Lisp has a name for that, maybe MAPCADR (for map Contents of Address, Data Register). That name wouldn't really be descriptive for anybody not knowing Lisp though.

Maybe map_right_neighbour or map_rpair, or map_adjacent are ideas. I don't think that creating a formulaic name like map_a2 (with map being map_a1, and List::Util::pairwise being map_p2) would be helpful.