Linking ecology and evolution