ClojureScript

alter-meta! does not work on vars

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: 0.0-3211
  • Fix Version/s: None
  • Component/s: None
  • Labels:

Description

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

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

Activity

Hide
Kozhin Anton added a comment -

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

Show
Kozhin Anton added a comment - 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
Hide
Leon Grapenthin added a comment -

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

Show
Leon Grapenthin added a comment - Try (-> (var x) meta :meta-test)
Hide
Kozhin Anton added a comment -

it doesn't help.

Show
Kozhin Anton added a comment - it doesn't help.
Hide
Leon Grapenthin added a comment -

I guess you should open a new ticket then

Show
Leon Grapenthin added a comment - I guess you should open a new ticket then
Hide
Leon Grapenthin added a comment -

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

Show
Leon Grapenthin added a comment - Please isolate whether this exclusively happens when calling def without a value.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: