My opinionated 2 cents : I think the whole visibility feature was a 
mistake, it doesn't provide any value and it should be taken away from the 
compiler (I guess it would not break anything to ignore :private metadata 
and make every var public).

Every single time I asked myself whether I needed a var to be private, I 
ended up to the conclusion that I did not need this feature.

The most common scenario is when the value is an implementation detail. In 
this case there's generally good reasons to allow other namespaces to use 
it : you may want to test it in isolation, you may want to tinker with the 
implementation from another place. Your requirement is purely social, what 
you actually need is a way to tell your users "use this at your own risk, 
it expects sanitized input, it can break in future versions" and there's a 
bunch of ways to do it, as many already said : move it in a separate 
namespace, do not document it, use a naming convention (a prefix "-" or a 
suffix "*" are pretty common). Your users are not children : inform, don't 
forbid. If you ignore warnings, you deserve production bugs.

Now for the very exceptional case where you're positively sure a value 
won't make any sense outside of a restricted scope, clojure has this useful 
feature called lexical scoping :

(ns my.public.api)

(let [private (here be dragons)]
  (defn do-stuff [args]
    (stuff private args))
  (defn do-things [args]
    (things private args)))

Visibility enforced by the compiler. Guaranteed. Your IDE won't even 
suggest it.

On Thursday, March 1, 2018 at 12:35:27 PM UTC+1, Leon Grapenthin wrote:
> I guess unqualified meta keywords are reserved for the compiler anyway so 
> it could just warn if it doesn't know a unqualified kw.

You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
For more options, visit this group at
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 
For more options, visit

Reply via email to