list.extract function

Extract an element from a list or vector