<div dir="ltr"><div>It feels a bit off adding a mutable data structure to erlang where everything else by design is immutable.<br><br></div>Robert<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 9 July 2016 at 19:54, Constantin Kulikov <span dir="ltr"><<a href="mailto:zxnotdead@gmail.com" target="_blank">zxnotdead@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">If I want to add a new datastructure to erlang(my local fork of the erlang-otp from github), what should I do? Yes, I mean a C-level module realization.<div><br></div><div>Let's say I want to add a double linked list(just for simplicity) module with an interface like that:</div><div>dlist:new() -> ?some king of reference to a list?</div><div>dlist:push(item) -> ?reference to a list?</div><div>dlist:pop() -> {item, ?reference to a list?}</div><div>etc...</div><div><br></div><div><div>Is it possible at all? Has anyone ever tried to do something like this?</div></div><div>What definitions to what files should I add? How must I allocate my data structure? How must I reference items in it?<br></div><div>Can someone point me to source locations where erlang's list/ets table/tuple operations(creating a new, storing a reference to objects) defined?</div><div><br></div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>