string_slices: new callback-based constructor