Re: Namespace qualification of symbols

2013-06-20 Thread Phillip Lord
Jim jimpil1...@gmail.com writes:
 On 19/06/13 09:46, Phillip Lord wrote:
 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?

 Yes, this is very much expected! :)

 How else would you be able to write macros without ` ?

Well, that doesn't answer the question. The backtick is useful in
writing macros (although the situation this caused me grief, actually, I
wasn't). So is quote. But then I do not understand why the behaviour is
different between the two.

 Vars needs to resolve to something eventually...

There are no vars involved here. `paul expands to a namespace qualified
symbol irrespective of the existence of a var.

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.




Re: Namespace qualification of symbols

2013-06-20 Thread Ambrose Bonnaire-Sergeant
Hi Phil,

It's a good question.

Syntax quote is designed for generating code/syntax that is deterministic
and avoids accidental local name capture.

1. Automatic namespace qualification helps avoid accidental local name
capture in macros.

user= `(let [a# 1
  b# a]
  a#)
(clojure.core/let [a__48963__auto__ 1
   b__48964__auto__ user/a]
   a__48963__auto__)

The binding for b# shows a common mistake. By namespace qualifying a to
user/a,
we don't allow the possibility of accidentally capturing locals.

eg. a is not captured in the body
(let [a 'evil]
  (clojure.core/let [a__48963__auto__ 1
 b__48964__auto__ user/a]
 a__48963__auto__))

2. Automatic namespace qualification helps make code deterministic with
respect to the namespace
of the consumer of a macro.

Syntax quote resolves vars in the namespace the *macro* is defined in. This
avoids odd situations where
different vars are invoked depending on which namespace we use the macro.


Bottom line: syntax quote is designed for macros by default. All the good
properties of syntax quote can be avoided using
combinations of quote, syntax quote and splice.

eg. `~'a
;= a

Thanks,
Ambrose

On Thu, Jun 20, 2013 at 3:49 PM, Phillip Lord
phillip.l...@newcastle.ac.ukwrote:

 Jim jimpil1...@gmail.com writes:
  On 19/06/13 09:46, Phillip Lord wrote:
  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?
 
  Yes, this is very much expected! :)
 
  How else would you be able to write macros without ` ?

 Well, that doesn't answer the question. The backtick is useful in
 writing macros (although the situation this caused me grief, actually, I
 wasn't). So is quote. But then I do not understand why the behaviour is
 different between the two.

  Vars needs to resolve to something eventually...

 There are no vars involved here. `paul expands to a namespace qualified
 symbol irrespective of the existence of a var.

 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.




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




Re: Namespace qualification of symbols

2013-06-20 Thread Jim - FooBar();

On 20/06/13 08:49, Phillip Lord wrote:

Well, that doesn't answer the question. The backtick is useful in
writing macros (although the situation this caused me grief, actually, I
wasn't). So is quote. But then I do not understand why the behaviour is
different between the two.


I thought the question was whether this is expected or not that's why I 
answered accordingly...What I wanted to get across is that ` is critical 
for generating code (macro-writing) whereas ' has nothing to do with 
macros really. It's just a way of saying 'skip evaluation of this symbol 
- just pass it along'. However, whenever you do `(map ~f ~coll) what you 
really mean is (clojure.core/map some-fn some-coll) and that is exactly 
what the macro will expand to. Say, you had overwritten 'core.map' with 
your own version in that namespace...then the macro would expand to  
(some-namespace/map some-fn some-coll) . If you swap ` for ' then what 
you get is a list with a bunch of non-qualified symbols in. Not very 
useful is it?


Ambrose went a bit further and explained local-name capturing  gensym. 
Even though automatic namespace qualification helps with that, it seems 
to be that this is not the primary reason for it. Being able to generate 
code dynamically without having to qualify every single symbol sounds 
more important to me...after all, avoiding local name capturing can be 
considered the programmer's responsibility...ok, the language helps with 
gensym etc but it should always be in the back of your head when writing 
macros. Even with gensym and syntax-quote there is still a way to 
achieve name capturing and I think 'the joy of Clojure' demonstrates an 
'arguably useful'  example of this...


to sum up the behaviour is different because `  ' are used to achieve 
different tasks. It often helps me to think of ` as resolving the symbol 
whereas ' doesn't do anything to it.


hope this is clearer now...

this is nice video http://www.infoq.com/presentations/Clojure-Macros 
that explains the compilation process of Clojure and how macros make it 
harder to grasp.


Jim

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




Re: Namespace qualification of symbols

2013-06-20 Thread Phillip Lord
Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com writes:
 It's a good question.

 Syntax quote is designed for generating code/syntax that is deterministic
 and avoids accidental local name capture.

 1. Automatic namespace qualification helps avoid accidental local name
 capture in macros.

 user= `(let [a# 1
   b# a]
   a#)
 (clojure.core/let [a__48963__auto__ 1
b__48964__auto__ user/a]
a__48963__auto__)

 The binding for b# shows a common mistake. By namespace qualifying a to
 user/a,
 we don't allow the possibility of accidentally capturing locals.

 eg. a is not captured in the body
 (let [a 'evil]
   (clojure.core/let [a__48963__auto__ 1
  b__48964__auto__ user/a]
  a__48963__auto__))



Ah, yes, this makes sense. So, rewriting the macro without the backtick
looks exactly the same, but can capture locals.

(defmacro remap3 [f  c]
  `(map ~f ~@c))

(defmacro remap4 [f  c]
  (list* 'map f c))

(let [map (fn [f  c]
(println evil)
(apply f c))]
  (remap3 identity (range 1 10)))

(let [map (fn [f  c]
(println evil)
(apply f c))]
  (remap4 identity (range 1 10)))


Only the latter is evil.


 2. Automatic namespace qualification helps make code deterministic with
 respect to the namespace of the consumer of a macro.

 Syntax quote resolves vars in the namespace the *macro* is defined in.
 This avoids odd situations where different vars are invoked depending
 on which namespace we use the macro.


Yeah, this was what was confusing me, and was breaking my code. I was
using it to generate code, but not in a macro; my code generates a set
of (specific) Java objects from clojure, and I wanted to be able to
reverse the process -- render clojure forms from Java objects; this
was failing because the symbols were always being qualified in the
namespace of the renderer. In essence, I'm using ` for it's syntactic
convienience, rather than in a macro.


 Bottom line: syntax quote is designed for macros by default. All the good
 properties of syntax quote can be avoided using
 combinations of quote, syntax quote and splice.

 eg. `~'a
 ;= a


I have converted my code to use this! 

Thanks for the explanation. I was confused.

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.




Re: Namespace qualification of symbols

2013-06-20 Thread Phillip Lord

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.

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.




Re: Namespace qualification of symbols

2013-06-20 Thread Phillip Lord
Jim - FooBar(); jimpil1...@gmail.com writes:
 On 20/06/13 08:49, Phillip Lord wrote:
 Well, that doesn't answer the question. The backtick is useful in
 writing macros (although the situation this caused me grief, actually, I
 wasn't). So is quote. But then I do not understand why the behaviour is
 different between the two.

 However, whenever you do `(map ~f ~coll) what you really mean is
 (clojure.core/map some-fn some-coll) and that is exactly what the
 macro will expand to.

In my case, when I really meant was (map somefn somecoll) hence the
confusion. 


 If you swap ` for ' then what you get is a list with a bunch of
 non-qualified symbols in. Not very useful is it?


It does depend on what you are doing. I was generating data that could
be evaluated as code at some point.


 Ambrose went a bit further and explained local-name capturing  gensym. Even
 though automatic namespace qualification helps with that, it seems to be that
 this is not the primary reason for it. Being able to generate code dynamically
 without having to qualify every single symbol sounds more important to
 me...


You can do this either way. 

(defmacro remap3 [f  c]
  `(map ~f ~@c))

(defmacro remap4 [f  c]
  (list* 'map f c))

I haven't qualified map in either case, both still work. But, as Ambrose
explanation shows, the former definition is better, because in the
former it is clearer what environment the qualitification takes place.

 hope this is clearer now...

It is! Both the reasoning behind the problem and how to avoid it was
causing me grief.

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.




Re: Namespace qualification of symbols

2013-06-20 Thread Ambrose Bonnaire-Sergeant
On Thu, Jun 20, 2013 at 8:50 PM, Phillip Lord
phillip.l...@newcastle.ac.ukwrote:

 Thanks for the explanation. I was confused.


Cheers, glad it helped.

Ambrose

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




Re: Namespace qualification of symbols

2013-06-20 Thread Michał Marczyk
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.




Namespace qualification of symbols

2013-06-19 Thread Phillip Lord



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.




Re: Namespace qualification of symbols

2013-06-19 Thread Jim

On 19/06/13 09:46, Phillip Lord wrote:

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?


Yes, this is very much expected! :)

How else would you be able to write macros without ` ?
Vars needs to resolve to something eventually...

Jim

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




Re: Namespace qualification of symbols

2013-06-19 Thread Leon Barrett
Yes, it's expected, and if you need unqualified names you need to carefully
unquote and requote, e.g.

(defmacro def-a-fn [body]
  `(defn ~'a-fn  ;; you can only define unqualified names, I think
 [] ~@body))


On Wed, Jun 19, 2013 at 3:32 AM, Jim jimpil1...@gmail.com wrote:

 On 19/06/13 09:46, Phillip Lord wrote:

 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?


 Yes, this is very much expected! :)

 How else would you be able to write macros without ` ?
 Vars needs to resolve to something eventually...

 Jim


 --
 --
 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+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en
 --- You received this message because you are subscribed to a topic in the
 Google Groups Clojure group.
 To unsubscribe from this topic, visit https://groups.google.com/d/**
 topic/clojure/a4Dp8gdHev8/**unsubscribehttps://groups.google.com/d/topic/clojure/a4Dp8gdHev8/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
 .
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://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.




Re: Namespace qualification of symbols

2013-06-19 Thread Colin Fleming
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.




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