Stefan Monnier wrote: >>> To avoid modifying more values than specified, that modifying function >>> uses a `when` condition. I'm not sure of a good way to stop `seq-do` >>> early when we know that it can stop calling the modifying function. >>> Normally, I would use `cl-block` and `cl-return`. Is it OK to use those >>> features in `seq.el`? If not, is it worth adding something like a >>> `seq-map-while` or a `seq-do-while`? > > `seq.el` is used by some parts of the implementation of `cl-lib`, so > the use of `cl-lib` risks introducing a circular dependency. Maybe using > `cl-block/return` would be OK, but I wouldn't be surprised if it causes > bootstrap trouble. You can use catch/throw, OTOH. > > > Stefan > Attached is an updated version using `catch` and `throw`. Thank you for pointing those out to me. The patch is also changed to signal `args-out-of-range` for the start and end indexes to be more like `seq-subseq`. How does it look?