alter-meta! does not work on vars

Description

(alter-meta! (var +) assoc :foo 42)
;-> {:foo 42} ;; wrong

(:foo (meta (var +)) :incorrect)
;-> :incorrect

Environment

None

Activity

Leon Grapenthin October 16, 2015 at 6:06 PM

Please isolate whether this exclusively happens when calling def without a value.

Leon Grapenthin October 16, 2015 at 6:04 PM

I guess you should open a new ticket then

import October 16, 2015 at 6:01 PM

Comment made by: kozhin_a

it doesn't help.

Leon Grapenthin October 16, 2015 at 11:11 AM

Try (-> (var x) meta :meta-test)

import October 16, 2015 at 10:41 AM

Comment made by: kozhin_a

I try next code in clojurescript version 1.7.122

(def x)
(alter-meta! (var x) assoc :meta-test "test")
(println (= (-> x meta :meta-test) "test"))
=>false

Completed

Details

Assignee

Reporter

Affects versions

Priority

Created May 5, 2015 at 5:58 PM
Updated October 16, 2015 at 6:06 PM
Resolved October 16, 2015 at 6:06 PM