Skip to end of metadata
Go to start of metadata


Not convenient communicating to analysis

  • Only specific reader metadata survives analysis
    • Usually related to compilation or debugging
    • :tag, :line, :static
    • Can only attach in specific contexts
      • parameters
      • local bindings
  • Makes it difficult communicating to tools that utilise the results of analysis
  • Example: attaching metadata to function calls
    • ^{:my-m 1} (float? 1)
    • :my-m is irretrievable from analysis
    • Problem: cannot expect to attach metadata to macro calls or inlining functions.
  • Any other examples?
  • Use case: annotating polymorphic function calls with type arguments in Typed Clojure
    • ^{:inst [Integer Integer]} (my-poly arg1 arg2)
  1. May 07, 2012

    Regarding the macro/inline problem, you might be interested in I have a patch which, if applied, would make it possible to attach this metadata to macros and (I think) inlined functions without issue.