Extract a slice from a list