On 10 February 2015 at 11:36, <guy.bar...@signal.uk.com> wrote:
>
> I also do  (assoc this :jetty nil) instead of (dissoc this :jetty-server)
> as the dissoc will stop it being a defrecord.
>

dissoc only turns the record into a map if you remove one of its core
fields:

user=> (defrecord Foo [x])
user.Foo

user=> (def f (map->Foo {:x 1 :y 2}))
#'user/f

user=> f
#user.Foo{:x 1, :y 2}

user=> (dissoc f :y)
#user.Foo{:x 1}

user=> (dissoc f :x)
{:y 2}


Keys that hold temporary objects, like server instances or connections,
should probably not be core fields.

- James

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

Reply via email to