Implementing `range`.