That works! Awesome! On Thu, Jul 14, 2011 at 5:17 AM, Jonathan Fischer Friberg < odysso...@gmail.com> wrote:
> I see I misunderstood the question, sorry about that. > > What you want is a macro: > > (defmacro string-maker [string-name the-string] > `(def ~(symbol string-name) ~the-string)) > > Jonathan > > > On Thu, Jul 14, 2011 at 1:13 PM, Giancarlo Angulo <igan.l...@gmail.com>wrote: > >> Please look at this: >> http://clojure.org/data_structures >> see maps. >> ================================ >> Giancarlo Angulo >> ================================ >> -----|-^_^X@^_^,=====|+^_^X~_~@----- >> ================================ >> >> >> >> >> On Thu, Jul 14, 2011 at 2:41 PM, Tuba Lambanog >> <tuba.lamba...@gmail.com>wrote: >> >>> Hello, >>> Total noobie here. I'm trying to create a sort of a string maker >>> function. Something like: >>> >>> (defn string-maker [string-name the-string] >>> (def string-name (str the-string))) >>> >>> so that I can call the function like so: >>> >>> (string-maker "friend" "Peter") >>> >>> which I expect to give me the variable: friend >>> with the value: Peter >>> >>> But alas, no luck. Can anybody point me in the right direction? >>> Thanks! >>> tuba >>> >>> -- >>> 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 > -- 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