I'd love to be able to do this:

(defstruct person-s :name :gender)
(def name-a (accessor person-s :name))
(def gender-a (accessor person-s :gender))

(def person-1 (struct person-s "Jane" :female))

(let [{name name-a, gender gender-a, :as person} person-1]
  (println name gender person))

...instead of having to do this:
(let [person person-1, name (name-a person), gender (gender-a person)]
  (println name gender person))

In other words, rather than the rule being that, in a map in a let
binding, the values of symbol keys must be keywords so that the key
symbol is bound to (keyword the-map):
  (let [{name :name} person-1] ...) ; name is bound to (:name
person-1)

...I'd love it if the values of symbol keys could be any symbol, not
just keywords, so that the key symbol is bound to (val-symbol
the-map):
  (let [{name this-is-a-symbol} person-1] ...) ; name is bound to
(this-is-a-symbol person-1)

It's backwards-compatible. But is this possible? Practical?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to