Sep. 25th, 2016

dmm: (dynosaur)
(defn rec-map-mult [scalar rec-map-of-ns]
  (if (map? rec-map-of-ns)
      (into {}
            (map #(vector (first %1)
                          (rec-map-mult scalar (second %1))
                  )
                 rec-map-of-ns
            )
      )
      (if (number? rec-map-of-ns)
          (* scalar rec-map-of-ns)
          0
      )
  )
)

user=> (rec-map-mult  3 { :a 3 :b {:c 7 :d 9} })
{:a 9, :b {:c 21, :d 27}}

Profile

dmm: (Default)
Dataflow matrix machines (by Anhinga anhinga)

April 2026

S M T W T F S
   1234
56 7891011
12131415161718
19202122232425
26 27282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 7th, 2026 03:54 am
Powered by Dreamwidth Studios