Is this expected behavior with meta data?

2015-06-25 Thread Sarkis Karayan
Why doesn't this work? user=> (meta ^{:some-meta 123} 'n) nil While this works: user=> (meta ^{:some-meta 123} (fn [n] n)) {:some-meta 123} And this works too: user=> (meta (with-meta 'n {:some-meta 123})) {:some-meta 123} Is this intended behavior? If so, what's the reasoning? Thanks, Sarki

Re: Is this expected behavior with meta data?

2015-06-25 Thread gianluca torta
to get the meta-data of a var (I'm guessing symbol n refers to a var...) you should call it on the var iself, not its value or symbol: user=> (def ^{:some-meta 123} n 0) #'user/n user=> (meta n) nil user=> (meta 'n) nil user=> (meta #'n) {:some-meta 123, :ns #, :name n, :file "NO_SOURCE_PATH",

Re: Is this expected behavior with meta data?

2015-06-25 Thread Andy-
There was just this question the other day: http://stackoverflow.com/questions/30922413/why-does-metadata-symbol-not-work There is also a few threads a few weeks ago here on google groups about it: https://groups.google.com/d/msg/clojure/_e7vBom2acw/0AAKTiGuzv4J HTH On Thursday, June 25, 2015