Thanks for the replies. Mr. Brandmeyer's solution is exactly what I
needed; I don't really want to change rep+'s return value from a
vector, which would sort of break backwards compatibility.

On Jun 26, 8:25 am, Meikel Brandmeyer <m...@kotka.de> wrote:
> Hi,
>
> Am 26.06.2009 um 17:09 schrieb samppi:
>
> > @Mr. Gilardi, this is for a one-time only thing. I have a function,
> > called rep*, that builds up a vector from left to right. Another,
> > separate function, called rep+, calls rep*, but it needs to slip in an
> > element at the vector's beginning.
>
> Maybe you can pass the rep+ element as an
> option to rep*?
>
> (defn rep*
>    ([stuff] (rep* [] stuff))
>    ([v stuff]
>     (reduce conj v stuff)))
>
> (defn rep+
>    [stuff]
>    (rep* [my-val] stuff))
>
> But that might depend on the how my-val is
> calculated and whether it depends on the
> output of rep* and whether you call rep* at
> all from rep+...
>
> Sincerely
> Meikel
>
>  smime.p7s
> 2KViewDownload
--~--~---------~--~----~------------~-------~--~----~
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