<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Mailer issues lost my first draft and resulted in the 2nd being only<div>addressed to Bob. Posting for the list and feedback.<div><br><div><div>On Jun 23, 2014, at 7:18 PM, Jay Nelson <<a href="mailto:jay@duomark.com">jay@duomark.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jun 22, 2014, at 11:16 AM, Bob Ippolito <<a href="mailto:bob@redivi.com">bob@redivi.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra">If you do want to keep a full history of inserts, couldn't you use a dict(K, [V])? Sure, you'd have to write a few functions, since dict:append/3 doesn't have the desired semantics, but such functions are straightforward to write.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">prepend(K, V, D) -></div><div class="gmail_extra">    dict:update(K, fun (Vs) -> [V | Vs] end, [V], D).</div></div></blockquote><br></div><div>It’s kind of funny that the imperative append is provided in our functional dict</div><div>module. I guess it mirrors the thinking on the init list. This is a simple approach</div><div>to keep versioned data for all keys.</div><div><br></div><div>I rambled too much in my original post. My question was actually only about the</div><div>initialization. I am trying to make an abstract dictionary for object-like handling</div><div>of data, with translation between DB access and Application access. The seeds</div><div>of the idea are at <a href="https://github.com/duomark/epode/tree/dict-types">https://github.com/duomark/epode/tree/dict-types</a> (I haven’t</div><div>merged the latest code to master yet).</div><div><br></div><div>As a library I wanted to provide a convenient initialization method with proplists</div><div>as my guide, because initializing sets of objects with defaults and contextual</div><div>overrides fits the model of push down contexts or environments better. I am</div><div>curious if people initialize their dictionaries with imperatively constructed lists</div><div>(with the most recent change at the end, relying on clobber semantics) or</div><div>with push/pop contexts on top of default values.</div><div><br></div><div>The recommended approach for maps is to merge a default map with the</div><div>overrides (or I suppose a sequence of overrides and rule for proper merge</div><div>ordering). Dictionaries appear to be an imperative approach that has been</div><div>adapted to functional in a way that exhibits features of both approaches.</div><div>I was conditioned with LISP to use proplists and environment contexts.</div><div><br></div><div>jay</div><div><br></div><br></div></blockquote></div><br></div></div></body></html>