That's what I get for copy/pasting a link from Google Groups. The real
URL for the JIRA ticket is http://dev.clojure.org/jira/browse/CLJ-863
if you'd rather avoid the pointless redirect.

On Nov 2, 7:02 pm, Alan Malloy <a...@malloys.org> wrote:
> http://groups.google.com/group/clojure-dev/browse_thread/thread/b81c6...
>
> http://www.google.com/url?sa=D&q=http://dev.clojure.org/jira/browse/C...
>
> On Nov 2, 6:28 pm, Alex Baranosky <alexander.barano...@gmail.com>
> wrote:
>
>
>
>
>
>
>
> > Something interesting I've noticed:
>
> > I've recently realized I could simplify some application code of mine by
> > using interleave.  I immediately noticed that in the spot I was using it I
> > would never be sure to have 2+ streams (from
> > here<https://github.com/AlexBaranosky/EmailClojMatic/blob/master/src/remin...>
> > ):
>
> > (defmethod parse-reminder-dates :day-of-month [s]
> >    (let [[ordinals-part] (re-captures day-of-month-identifier-regex s)
> >          ordinals (map ordinal-to-int (re-match-seq ordinal-regex
> > ordinals-part))]
> >      (apply interleave++ (map day-of-month-stream ordinals))))
>
> > For my purposes, in an application that might generate 0+ streams, it made
> > sense to create a variation of interleave, I dub interleave++:
>
> > (defn interleave++ [& colls]
> >    "like interleave from core, but does something sensible with 0 or 1
> > collection"
> >    (cond (empty? colls)
> >              []
>
> >              (= 1 (count colls))
> >              (first colls)
>
> >              :else
> >              (apply interleave colls)))
>
> > Is there a strategic reason interleave wasn't made to be a bit more
> > flexible, so as to be able to ignore checking for edge cases in the code
> > that uses interleave?
>
> > Best,
> > Alex

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to