<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 10, 2014 at 6:14 PM, Michael Loftis <span dir="ltr"><<a href="mailto:mloftis@wgops.com" target="_blank">mloftis@wgops.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":1c6" class="" style="overflow:hidden">I think you might mean the opposite here....that maps is ephemeral and<br>
ETS is persistent (or can be persistent using DETS anyway)</div></blockquote></div><br>Actually not. Two things to address though:</div><div class="gmail_extra"><br></div><div class="gmail_extra">Max might have asked if you can store maps in ets:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">5> ets:new(foo, [named_table]). </div><div class="gmail_extra">foo</div><div class="gmail_extra">6> ets:insert(foo, {#{a => 3, b => 4}}).</div>
<div class="gmail_extra">true</div><div class="gmail_extra">7> ets:match_object(foo, '_'). </div><div class="gmail_extra">[{#{a => 3,b => 4}}]</div><div><div>8> ets:insert(foo, #{'not' => possible}).</div>
<div>** exception error: bad argument</div><div> in function ets:insert/2</div><div> called as ets:insert(foo,#{'not' => possible})</div></div><div><br></div><div>and the answer is that you can, but the topmost entry must be a tuple as the example shows.</div>
<div><br></div><div>The other thing is about persistent vs ephemeral data structures. </div><div><br></div><div><a href="http://en.wikipedia.org/wiki/Persistent_data_structure">http://en.wikipedia.org/wiki/Persistent_data_structure</a><br>
</div><div><br></div><div>Maps are persistent, but ETS in general is not. It is ephemeral according to the wikipedia definition.</div><div><br></div><div><br></div><br clear="all"><div><br></div>-- <br>J.
</div></div>