On 20 June 2013 14:35, Phillip Lord <phillip.l...@newcastle.ac.uk> wrote:
> Oh yeah, how sneaky. In one case, you get a class, in the other, you get
> a symbol. Backtick is doing quite a bit more than letting you unquote
> and splice.

You get a symbol in both cases, though with a different name:

(import java.awt.image.BufferedImage)

(class `BufferedImage)
;= clojure.lang.Symbol

Cheers,
Michał


>
> Colin Fleming <colin.mailingl...@gmail.com> writes:
>> Thank you for this, you just fixed a bug for me :-)
>>
>> I was trying to do some tricky type hinting with definline using amolloy's
>> great answer <http://stackoverflow.com/a/11920022> on StackOverflow. Notice
>> that he uses `BufferedImage and not 'BufferedImage. I stupidly figured that
>> this was just a typo due to force of habit or similar and switched to using
>> quote, and discovered that I had problems when BufferedImage wasn't
>> imported when the inlined version of the function was called. Turns out
>> that ` expands an imported class name to the fully qualified name, whereas
>> ' does not.
>>
>> (import java.awt.image.BufferedImage)
>> => #=java.awt.image.BufferedImage
>> `BufferedImage
>> => java.awt.image.BufferedImage
>> 'BufferedImage
>> => BufferedImage
>>
>> Mea culpa. I'm not sure I would ever have made this connection, very timely
>> - thank you.
>>
>> Cheers,
>> Colin
>>
>>
>> On 19 June 2013 20:46, Phillip Lord <phillip.l...@newcastle.ac.uk> wrote:
>>
>>>
>>>
>>>
>>> So, I was thinking that ' and ` were basically the same, unless a ~ was
>>> involved somewhere. But I have discovered this.
>>>
>>>
>>>
>>> (ns john)
>>>
>>> (println '(paul))
>>> (println `(paul))
>>>
>>>
>>> ;;=>
>>> (paul)
>>> (john/paul)
>>>
>>> With the ' paul is not namespace qualified, while with the ` paul is.
>>>
>>>
>>> Turns out to be a bit of a pain, actually, although I have worked around
>>> it. But mostly I am surprised. Is this expected?
>>>
>>> Phil
>>>
>>> --
>>> --
>>> 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.
>>>
>>>
>>>
>>
>> --
>
> --
> Phillip Lord,                           Phone: +44 (0) 191 222 7827
> Lecturer in Bioinformatics,             Email: phillip.l...@newcastle.ac.uk
> School of Computing Science,            
> http://homepages.cs.ncl.ac.uk/phillip.lord
> Room 914 Claremont Tower,               skype: russet_apples
> Newcastle University,                   twitter: phillord
> NE1 7RU
>
> --
> --
> 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.
>
>

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