tools.reader

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

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • 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.)

This ticket essentially asks for these 3 accesses to be addressed so that they don't trigger spurious warnings if and when CLJS-1702 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 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 (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)

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: