or rather (for [y (range 1999 (inc 2010)) w (range 1 (inc 52))] [y w])
which remove the 2011 and 53 magic values ;-) 2010/7/7 Nurullah Akkaya <nurul...@nakkaya.com>: > You can build a sequence of year week pairs using, > > (for [y (range 1999 2011) > w (range 1 53)] [y w]) > > then you can iterate over that and print, > > (doseq [[y w] (for [y (range 1999 2011) > w (range 1 53)] [y w])] > (println "Year " y "Week " w)) > > > Hope it helps... > -- > Nurullah Akkaya > http://nakkaya.com > > > > On Wed, Jul 7, 2010 at 5:47 PM, uap12 <anders.u.pers...@gmail.com> wrote: >> Hi! >> I try to make a printout witch vill have year 1999->2010 and every >> week >> Eg. >> Year=1999 Week=1 >> Year=1999 Week=2 >> Year=1999 Week=3 >> Year=1999 Week=4 >> .... >> Year=2000 Week=1 >> >> I have made the program in java, but like to try making it in Clojure, >> but so far i have got >> ---------------------------------------------------------------------------------------------------------------------------------------------------- >> (defn print-data [year week] >> (println (str "Y=" year " W=" week))) >> >> >> // This would not work and i can't find how to map (print-data with a >> external variabel and a range >> // I can set week to a fixed number but not. >> // Or is this the wrong way of doing it ?? >> >> (defn print-data2 [year] >> (map (print-data year *) (range 1 53 1))) >> >> >> (defn run [] >> (map print-data2 (range 1999 2010 1) ) ) >> >> The program vill call an externa system program, with year and week as >> input, but for this test i just >> like to write them... >> >> // Anders >> >> -- >> 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 >> > > -- > 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 -- 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