That's what I do ! However I have the gut feeling that the :private metadata was designed for exactly this purpose, and many people (including me) don't use it because they don't want to rely on dirty hacks to access implementation from the outside. That's why I half-jokingly suggested the compiler could just ignore it. This would foster its use so we could fully leverage tools designed for it such as those Alex cited. We could still rely on linters to make sure we don't accidentally call implementation directly in production code. Or maybe a compiler warning is a good compromise. Of course this is just random thoughts, I started learning clojure around 1.6 and I may be missing something obvious, so please correct me if this has already been discussed before.
On Monday, March 5, 2018 at 9:26:09 AM UTC+1, Chris Ford wrote: > > This isn't foolproof Léo, but sometimes folks use docstrings to make that > distinction i.e. if it's got a docstring it's part of the public API. > Codox, for example, takes this approach when deciding what to include in > generated API documentation. > > On 4 March 2018 at 12:50, Léo Noel <leo.n...@gmail.com <javascript:>> > wrote: > >> Or maybe people are confused because the :private metadata *complects* >> two separate concerns : *API commitment* and *visibility*. >> If there was a way to programmatically make the distinction between >> implementation and API without impacting visibility, it would be >> tremendously valuable for tooling and I would definitely use it. >> >> >> On Saturday, March 3, 2018 at 6:02:00 PM UTC+1, Alex Miller wrote: >>> >>> > ^:private is the stale and sleazy co-conspirator of another blunt >>> instrument, the whole-ns :use. >>> >>> It’s also useful for anything that uses the var meta to show you only >>> public vars in an ns, such as dir, ns-publics, etc. those are all useful >>> and would affect your repl experience even if you never :use or :refer >>> :all. >>> >>> I find people have different relationships with :private depending on >>> what kind of work they do. It’s very useful in in libs for delineating >>> public apis, much less important in an app context. >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clo...@googlegroups.com >> <javascript:> >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+u...@googlegroups.com <javascript:> >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+u...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.