2012/4/30 Ben Smith-Mannschott <[email protected]> > On Mon, Apr 30, 2012 at 18:22, Jay Fields <[email protected]> wrote: > > Foo$Bar is the name of the class, and $ is a valid character in a Java > class > > name. Foo$Bar is not a clojure symbol. > > Sure it is. The reader has to read it somehow. Otherwise the compiler > will have nothing to work with. Also: > > user=> (symbol? (read-string "foo$bar")) > true > > But, since $ isn't documented as being a valid character in a symbol, > I guess it's one of those cases of "undefined behavior". Perhaps > Clojure's own interop shouldn't build on undefined behavior? >
Shouldn't that be interpreted as : $ is a reserved character in symbols, and you cannot create symbols with $ inside them. That is, what is valid symbol construction from the consumer side is not the same of what is the set of accepted symbols from the reader library author side ... ? > > // ben > > > > > On Mon, Apr 30, 2012 at 12:19 PM, Philip Potter < > [email protected]> > > wrote: > >> > >> Note that, even though this works, $ is not a valid character in a > >> clojure symbol. > >> > >> See > >> > http://groups.google.com/group/clojure/browse_thread/thread/5af5d892f2e84212/0c5dc6b6a1578f07?#0c5dc6b6a1578f07 > >> > >> and http://clojure.org/reader > >> > >> So: is the behaviour discussed intentional? If so, should $ be made > >> explicitly valid in symbols? > >> > >> Phil > >> > >> On 30 April 2012 16:59, Jay Fields <[email protected]> wrote: > >> > That's correct. You'll want to make sure you (:import Foo$Bar) also. > >> > > >> > more > >> > > >> > info: > http://blog.jayfields.com/2011/01/clojure-using-java-inner-classes.html > >> > > >> > Cheers, Jay > >> > > >> > On Mon, Apr 30, 2012 at 11:44 AM, Tassilo Horn < > [email protected]> > >> > wrote: > >> >> > >> >> nick rothwell <[email protected]> writes: > >> >> > >> >> > I'm faced with the following in some legacy code: > >> >> > > >> >> > public interface Foo { interface Bar { ... String BAZ = "baz"; ... > }} > >> >> > > >> >> > Is there any way of accessing Foo.Bar.BAZ in the Clojure world? > I've > >> >> > tried various combinations of proxying and reifying with no joy. > >> >> > >> >> Not tested, but I think it's Foo$Bar/BAZ. > >> >> > >> >> Bye, > >> >> Tassilo > >> >> > >> >> -- > >> >> You received this message because you are subscribed to the Google > >> >> Groups "Clojure" group. > >> >> To post to this group, send email to [email protected] > >> >> Note that posts from new members are moderated - please be patient > with > >> >> your first post. > >> >> 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 > >> > > >> > > >> > -- > >> > You received this message because you are subscribed to the Google > >> > Groups "Clojure" group. > >> > To post to this group, send email to [email protected] > >> > Note that posts from new members are moderated - please be patient > with > >> > your > >> > first post. > >> > 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 > >> > >> -- > >> You received this message because you are subscribed to the Google > >> Groups "Clojure" group. > >> To post to this group, send email to [email protected] > >> Note that posts from new members are moderated - please be patient with > >> your first post. > >> 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 > > > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to [email protected] > > Note that posts from new members are moderated - please be patient with > your > > first post. > > 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 > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > 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 > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. 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
