It's fairly common to let over a function, e.g.:

(let [a (atom 0)]
  (defn next-id []
    (swap! a inc)))

In the above, the atom can only be referenced from within the lexical
scope of the let, hence essentially private to the next-id function.

On Oct 11, 8:03 am, lprefonta...@softaddicts.ca wrote:
> (:use [clojure.contrib.def])
>
> (defvar- x ...)
>
> A bit shorter than writing the meta-data by hand.
>
> Def provides a number of other interesting shortcuts. Have a look at
> def.clj in contrib.
> I prefer to keep things private and avoid cluttering the use
> clause with a long :only list. I use :only only when I end up with a name
> conflict.
>
> Luc P.
>
> HiHeelHottie <hiheelhot...@gmail.com> wrote ..
>
>
>
>
>
> > I want to define and use a map that is private to a namespace and used
> > by several functions in that namespace.  Is the idiomatic way simply
> > to def it within the namespace?  Is there another way to hide it?
>
> > --
> > 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 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

Reply via email to