Is clojure.lang really just implementation details?

Clojure performs some tasks (for example, creating PersistentQueueor using deftypea custom data type that is compatible with functions clojure.core) that requires knowledge of classes and / or interfaces in clojure.lang.

However, according to clojure.lang/package.html:

The only class that is considered part of the public the API, clojure.lang.IFn. All other classes should be considered implementation details.

Are these statements incorrect or obsolete? If so, do they plan to fix them in the future? If not, is there a preferable way to accomplish the above tasks, or will they simply not be performed at all in idiomatic Clojure code?

+4
source share
1 answer

Alex Miller commented on this in the past (the whole stream is worth reading):

I would say that there are many "publicly available" for the internal elements of Clojure.

  • The new Clojure API (clojure.java.api.Clojure) is the official public API for external Clojure callers. This API mainly consists of ways to solve vars and call functions.
  • For Clojure users in Clojure, almost any var that is open and has a docstring and is displayed in the api docs can be considered an open API.
  • Clojure vars, docstring (, var api docs), , .
  • Java Clojure [clojure.lang], , , , Clojure. , - - , "", , , , , , .
  • Java Clojure [clojure.lang] . .

, . , , , , , , .

+2

Source: https://habr.com/ru/post/1616869/


All Articles