Thanks! I think that should do it for me.

I've been writing my own custom *semi* JSON parser/combinator (JSON
only hacked to  let me to include js functions).
My first cut works, but I had implemented string searches for js
qualifiers. I didn't like the implementation since it string searches
every string, js-fn or not.
And since I have to check type already I can use that without adding
any real overhead.

Thanks.
Tim


On Jun 24, 11:42 am, Meikel Brandmeyer <m...@kotka.de> wrote:
> Hi,
>
> Am 24.06.2010 um 07:36 schrieb Tim Robinson:
>
> > Is it possible to define custom atom/data types?
>
> > Example: I would like an atom prefixed with $ to maintain it's own
> > type/class.
>
> > i.e.
> >> (class $myatom)
> > clojure.lang.CustomeName
>
> You can use the old way of "defining" types: by adding a tag to the metadata 
> of the atom.
>
> user=> (def a (atom nil :meta {:type ::MyType}))
> #'user/a
> user=> (type a)
> :user/MyType
> user=> (def b (atom nil))
> #'user/b
> user=> (type b)
> clojure.lang.Atom
>
> Sincerely
> Meikel

-- 
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