On Oct 20, 3:51 pm, "Fredrik Appelberg" <[EMAIL PROTECTED]>
wrote:
> Hi all,
>
> The CL feature for handling multiple return values from a function come in
> really handy sometimes and make for cleaner APIs. For example, the ROUND
> function returns the integer part of a float as the regular value (as this
> is what you want most of the time), but optionally also returns the floating
> point part in case you want it.
>
> I haven't found anything like MULTIPLE-VALUE-BIND in Clojure. Are there any
> plans of incorporating any kind of mechanism for multiple return values?
Hi Fredrik,
Similar results can be accomplished using vectors and
destructuring in Clojure.
user=> (defn foo [] [:one :two :three])
#=(var user/foo)
user=> (let [[a b c] (foo)] (println b))
:two
nil
user=>
The destructuring capabilities of "let" are quite nice.
A bunch of examples are available in the let reference:
http://clojure.org/special_forms
Parth
>
> Cheers,
> -- Fredrik
> ==============================================
> What am I up to?http://twitter.com/appelberg
--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---