Right, I forgot about dropf and friends. I was looking at drop, which requires me to know the index. Yes, that works fine. Thanks.
On Tue, Nov 8, 2016 at 4:56 PM, Vincent St-Amour < stamo...@eecs.northwestern.edu> wrote: > There's no built-in function that does exactly that. > > It's pretty straightforward to implement using a combination of `dropf` > and `dropf-right`, though. > > Vincent > > > > On Tue, 08 Nov 2016 15:50:56 -0600, > David Storrs wrote: > > > > Given a list of arbitrary data, I'd like to be able to say "look through > > the list for X and Y; give me everything between them." Ideally there > > would be a way to specify inclusive/exclusive on that. > > > > Example: (between-items '(a b c d e f) 'b 'e) => '(b c d e) > > > > Ideally it would also have a simple method for specifying which, if > > either, of the predicate-triggering items should be included in the > > return value. That way you could do: > > > > Example: (between-items '(a b c d e f) 'b 'e #:start #f) => '(c d e) > > Example: (between-items '(a b c d e f) 'b 'e #:end #f) => '(b c d) > > Example: (between-items '(a b c d e f) 'b 'e #:start #f #:end #f) => '(c > > d) > > > > I could write this manually, but I wonder if there is a simple Racket > > way? > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Racket Users" group. > > To unsubscribe from this group and stop receiving emails from it, send > > an email to racket-users+unsubscr...@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.