Skip to main content
Markup.
Source Link
ferada
  • 11.1k
  • 25
  • 63

Yes, this is the right way to do it.

Many Clojure programs do not bother with creating empty maps. The absence of a value or nil behave like an empty map. For example (assoc nil :foo :bar)(assoc nil :foo :bar) returns {:foo :bar}. You may be able to initialize to an empty sorted-mapsorted-map, and only assoc-inassoc-in novelty as you need it  ... depending on your logic.

Yes, this is the right way to do it.

Many Clojure programs do not bother with creating empty maps. The absence of a value or nil behave like an empty map. For example (assoc nil :foo :bar) returns {:foo :bar}. You may be able to initialize to an empty sorted-map, and only assoc-in novelty as you need it... depending on your logic.

Yes, this is the right way to do it.

Many Clojure programs do not bother with creating empty maps. The absence of a value or nil behave like an empty map. For example (assoc nil :foo :bar) returns {:foo :bar}. You may be able to initialize to an empty sorted-map, and only assoc-in novelty as you need it  ... depending on your logic.

deleted 44 characters in body
Source Link

Yes, this is the right way to do it. (apply sorted-map (for ...)) also works.

Many Clojure programs do not bother with creating empty maps. The absence of a value or nil behave like an empty map. For example (assoc nil :foo :bar) returns {:foo :bar}. You may be able to initialize to an empty sorted-map, and only assoc-in novelty as you need it... depending on your logic.

Yes, this is the right way to do it. (apply sorted-map (for ...)) also works.

Many Clojure programs do not bother with creating empty maps. The absence of a value or nil behave like an empty map. For example (assoc nil :foo :bar) returns {:foo :bar}. You may be able to initialize to an empty sorted-map, and only assoc-in novelty as you need it... depending on your logic.

Yes, this is the right way to do it.

Many Clojure programs do not bother with creating empty maps. The absence of a value or nil behave like an empty map. For example (assoc nil :foo :bar) returns {:foo :bar}. You may be able to initialize to an empty sorted-map, and only assoc-in novelty as you need it... depending on your logic.

Source Link

Yes, this is the right way to do it. (apply sorted-map (for ...)) also works.

Many Clojure programs do not bother with creating empty maps. The absence of a value or nil behave like an empty map. For example (assoc nil :foo :bar) returns {:foo :bar}. You may be able to initialize to an empty sorted-map, and only assoc-in novelty as you need it... depending on your logic.