I am taking up a discussion from 2010:
https://groups.google.com/group/clojure/browse_frm/thread/60dff89149c3d2e6/

I would prefer if it would be possible to define "closed maps", e.g.
maps that allow only a certain set of keywords, both for get and
"set" (like in assoc, assoc-in, update-in, ...). It would be nice if
there would be an option on defrecord to mark the map as "closed".

I imagine that this would have some runtime penalty, because for every
access it has to be verified if the key is a valid one. I understand
that. Perhaps in that case the language could react differently based
on the value of a dynamic var (*check-closed-defrecrod-p*) that can be
set when the unit tests are run and could be false by default.

I guess this topic was already discussed several times. Could somebody
point me to previous discussions and their outcome?
I've found in addition the following thread where the idea of "safe
maps" was discussed to some extent:
https://groups.google.com/group/clojure/browse_frm/thread/134642cc76de17f7/

Thanks,
Christian

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