On Thu, Nov 17, 2016 at 04:10:32PM +0100, Alexander Burger wrote: > (? > @Sdate (cons Sdate T) # Range with open end > @Edate (cons Edate NIL) # Reversed range with open start > (select (@Proj) > ((sDate +Proj @Sdate) (eDate +Proj @Edate)) # Search two indexes in > parallel > (range @Sdate @Proj sDate) # Check ranges > (range @Edate @Proj eDate) ) ) # Check ranges
Sorry, that's probably wrong. You want both start and end to be in the range, right? Then better: (? @Rng (cons Sdate Edate) # Range (select (@Proj) ((sDate +Proj @Rng) (eDate +Proj @Rng)) # Search two indexes in parallel (range @Rng @Proj sDate) # Check ranges (range @Rng @Proj eDate) ) ) # Check ranges The corresponding 'collect' would be (filter '((This) (and (>= Edate (: sDate) Sdate) (>= Edate (: eDate) Sdate) ) ) (collect 'sDate '+Proj Sdate (+ Edate 100)) ) Again, not tested! ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe