Uploaded image for project: 'Clojure'
  1. CLJ-1278

State function's unmunged full name in compiled function's toString()

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: Release 1.5
    • Fix versions: None
    • Labels:
    • Approval:
      Triaged
    • Patch:
      Code and Test

      Description

      Currently function instances print their toString() with the munged Java name:

      user=> (ns proj.util-fns)
      nil
      proj.util-fns=> (defn a->b [a] (inc a))
      #'proj.util-fns/a->b
      proj.util-fns=> a->b
      #object[proj.util_fns$a__GT_b 0x141ba1f1 "proj.util_fns$a__GT_b@141ba1f1"]
      

      For debugging purposes, it would be useful to have the function toString() describe the Clojure-oriented fn name.

      Approach: Store the original name in the function instance and use it in the toString() rather than returning the class name.

      proj.util-fns=> a->b
      #object[proj.util_fns$a__GT_b 0x47d1a507 "proj.util-fns/a->b(NO_SOURCE_FILE:2)"]
      

      Tradeoffs: Increased function instance size for the function name.

      Patch: CLJ-1278-2.patch

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hlewisship Howard Lewis Ship
            • Votes:
              6 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: