Oh, right; I've said something silly. What I had in mind is something like 
(let [[x y] (if cond [(coll 0) (coll 1)] [default (first coll)]), which is 
quite common in e.g. macros with optional arguments. Also, vectors 
containing expressions can be used by functions returning multiple values, 
or the application data itself can be represented by vector (consider a 
function "rand-color", which returns a vector of 3 random numbers between 0 
and 255 (though, I'd rather use repeatedly in this case)).

воскресенье, 5 августа 2012 г., 22:28:09 UTC+6 пользователь Sean Corfield 
написал:
>
> On Sun, Aug 5, 2012 at 3:33 AM, Vinzent <ru.vinz...@gmail.com> wrote: 
> > Also, I have a huge number of literal vectors with expressions inside 
> > (typical example: (let [[x y] coll] ...) is an equvalent to [(coll 0) 
> (coll 
> > 1)]). 
>
> A destructuring vector is not the same thing as is being discussed 
> here: (let [[x y] coll] ...) is equivalent to (let [x (coll 0) y (coll 
> 1)] ...) which is not even a vector containing expressions. 
> -- 
> Sean A Corfield -- (904) 302-SEAN 
> An Architect's View -- http://corfield.org/ 
> World Singles, LLC. -- http://worldsingles.com/ 
>
> "Perfection is the enemy of the good." 
> -- Gustave Flaubert, French realist novelist (1821-1880) 
>

-- 
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

Reply via email to