On Nov 20, 6:39 am, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On 20 Nov., 11:29, Rock <[EMAIL PROTECTED]> wrote:
>
> > I was what the difference might be with respect to this:
>
> > `(let [frame ~frame]
> > (.setTitle frame ~title)
> > (.setVisible frame)
> > frame)
>
> This won't work, since - assuming you are in namespace
> user - the backquote will expand to...
>
> (let [user/frame (new JFrame)]
> (.setTitle user/frame "Sometitle")
> (.setVisible user/frame)
> user/frame)
>
> ... and hence the let will complain, since you are not
> allowed to use fully qualified symbols in a let form.
>
> Hence you need ~'frame (capturing frame => bad) or
> frame#/gensym (not capturing frame => good).
>
Yes. Please use auto-gensyms (name#):
`(let [frame# ~frame]
(.setTitle frame# ~title)
(.setVisible frame#)
frame#)
~' should be used for intentional capture only, i.e. rarely.
That section of the Wiki should be re-worked, IMO.
Rich
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---