Re: apply a function to a list and another parameter

2010-10-23 Thread Mike Meyer
On Fri, 22 Oct 2010 03:48:44 -0700 (PDT) Marc von Bihl wrote: > Hello, I am new to fucntional programming and have 2 questions: > > How can I apply a function to each element from a list and a second > parameter? > > (def lstr '("Hello1" "Hello2" "Hello3")) > > (defn addtoString [s1 s2] > (s

Re: apply a function to a list and another parameter

2010-10-23 Thread gaz jones
you could do something like: (map str ["hello1" "hello2" "hello3"] (repeat "world")) there is also a time macro: (time (println "oh hi")) On Fri, Oct 22, 2010 at 5:48 AM, Marc von Bihl wrote: > Hello, I am new to fucntional programming and have 2 questions: > > How can I apply a function to e

apply a function to a list and another parameter

2010-10-23 Thread Marc von Bihl
Hello, I am new to fucntional programming and have 2 questions: How can I apply a function to each element from a list and a second parameter? (def lstr '("Hello1" "Hello2" "Hello3")) (defn addtoString [s1 s2] (str s1 s2)) (apply (addtoString lstr "World")) - I need it for the follo