On Wed, Dec 21, 2011 at 3:10 PM, Alan Malloy <a...@malloys.org> wrote:
>
>
> On Dec 21, 12:03 pm, Jonas <jonas.enl...@gmail.com> wrote:
>> You can also do (.. boxWidget GetProp3D (SetUserTransform t)) or (->
>> boxWidget .GetProp3D (.SetUserTransform t))
>
> Well, neither of these are strictly equivalent to his original code,
> which returns the boxWidget; yours return the result of
> SetUserTransform. However, the option to leave off the parens, or
> use .. instead are both still valid. Leaving off the doto might be
> valid also, if he doesn't care about the return value.
>
> FWIW, I don't really care for .. - my understanding is it's fallen out
> of favor: it was added in the bad old days before -> existed.

I don't use .. in real code, but I use it a lot at the REPL because I
can chain a bunch of java methods without having to type dots. For
example, this:

   (.. foo getBar doBaz getYum)

instead of this:

  (-> foo .getBar .doBaz .getYum)

yeah. it's only 3 characters, but for whatever reason it sees to make
a difference to me :)

Dave

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