Uploaded image for project: 'tools.reader'
  1. TRDR-52

Private access of cljs.tools.reader/char-code

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Labels:
      None

      Description

      In cljs.tools.reader.edn there are 3 accesses of cljs.tools.reader/char-code, which is private.

      The accesses are on line 93, 99, and 110. Here is the first for reference:

      https://github.com/clojure/tools.reader/blob/135a7213a5b837b3b23de422f2004ff7a9975800/src/main/cljs/cljs/tools/reader/edn.cljs#L93

      (This is detectable with work in progress in CLJS-1702 Closed .)

      This ticket essentially asks for these 3 accesses to be addressed so that they don't trigger spurious warnings if and when CLJS-1702 Closed is ultimately shipped.

      Using #'char-code would prevent the private var access warnings (as it would with Clojure). If that kind of revision is undesirable (from a performance standpoint), and also making a copy of that utility function into the cljs.tools.reader.edn namespace is undesired, one potential third avenue of "addressing" this would be the possibility that CLJS-1702 Closed would introduce new metadata that can be placed on the symbols in order to simply suppress the ClojureScript analyzer warnings without otherwise affecting the generated code.

      That third avenue, which would need to await the outcome of CLJS-1702 Closed (to be sure that metadata will indeed be used, and for the final name of the metadata), would involve code that looks something like this

      (^:private-var-access-nowarn char-code (nth token i) base)
      

        Attachments

          Activity

            People

            • Assignee:
              bronsa Nicola Mometto
              Reporter:
              mfikes Mike Fikes
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: