There is also identity, which returns what it was passed, which seems
closer to what you described initially.

=> (identity "foo")
"foo"


(2013/08/25 20:41), Christian Sperandio wrote:
> Thanks, exactly what I want :)
> 
> Le 25 aoűt 2013 ŕ 13:40, László Török <ltoro...@gmail.com 
> <mailto:ltoro...@gmail.com>> a écrit :
> 
>> Hi,
>> 
>> (constantly 5)
>> 
>> will return a function that takes any number of args and always
>> returns 5.
>> 
>> See http://clojuredocs.org/clojure_core/clojure.core/constantly.
>> 
>> Las
>> 
>> 
>> 2013/8/25 Christian Sperandio <christian.speran...@gmail.com 
>> <mailto:christian.speran...@gmail.com>>
>> 
>> Hi,
>> 
>> Is there a function builds a function that returns always the
>> same value?
>> 
>> In coder words, this sort of function: (defn always [v] (fn [& _]
>> v))
>> 
>> If this function exists already, I prefer use it rather than 
>> reinvent the wheel :)
>> 
>> Christian
>> 
>> 
>> -- -- 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 <mailto: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 
>> <mailto:clojure%2bunsubscr...@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 unsubscribe from this group and
>> stop receiving emails from it, send an email to
>> clojure+unsubscr...@googlegroups.com 
>> <mailto:clojure%2bunsubscr...@googlegroups.com>. For more
>> options, visit https://groups.google.com/groups/opt_out.
>> 
>> 
>> 
>> 
>> -- László Török
>> 
>> -- -- 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 <mailto: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 
>> <mailto: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 unsubscribe from this group and
>> stop receiving emails from it, send an email to
>> clojure+unsubscr...@googlegroups.com 
>> <mailto:clojure+unsubscr...@googlegroups.com>. For more options,
>> visit https://groups.google.com/groups/opt_out.
> 

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to