<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 31, 2016, at 10:51 AM, Daniel Tartaglia <<a href="mailto:danielt1263@gmail.com" class="">danielt1263@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I use the below to do this:</span><div class="" style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">dict2 = dict1.map { $0.withUpdate($0.0, value: $0.1) }</div></div></blockquote></div><br class=""><div class="">I don’t see how this can work. Dictionary.map returns an Array, not a Dictionary.</div><div class="">Also, in the callback function $0 is the key, so your Dictionary.withUpdate method only makes sense if the key type of the Dictionary is another Dictionary, which seems … very unusual.</div><div class=""><br class=""></div><div class="">(To clarify, I wasn’t asking how to accomplish this; it’s pretty simple to write it either as an extension method or as a simple one-off ‘for’ loop. I was just making sure it wasn’t already in the standard library, since it seems an obvious thing to have.)</div><div class=""><br class=""></div><div class="">—Jens</div></body></html>