would it be possible to define a wrapper record? I mean something in the line of:<br>{data_wrapper, SomeKey, SomeData} ... such that SomeData can be whatever you need.<br><br><div><span class="gmail_quote">On 10/1/07, <b class="gmail_sendername">
shahzad bhatti</b> <<a href="mailto:bhatti_shahzad@yahoo.com">bhatti_shahzad@yahoo.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Though, I would like to use tuples of any arity, so that clients can store any tuples without defining schema. But it sounds like I will have to add that constraint for arity and record name. Also, is it possible for insert to automatically add table/schema if it does not exist. And is there any event that I can listen to know when tuples are added to simulate blocking read/remove (preferably using pattern based filtering). Thanks again.
<span class="q"><br><br><b><i>Ulf Wiger <<a href="mailto:ulf@wiger.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">ulf@wiger.net</a>></i></b> wrote:</span><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">
<span class="q"> Yes, you can use tuples directly. Unlike ets, mnesia requires<br>the key to be the second element in the tuple, and the first<br>element needs to be a label (record_name).<br><br>Mnesia will check that the inserted data is a tuple of the
<br>right arity, and that the first element of the tuple is equal<br>to the 'record_name' of the table (this defaults to the
table<br>name, but can be changed with the {record_name, N} option.<br><br>Remember, records are only syntactic sugar for tagged tuples.<br><br>BR,<br>Ulf W<br><br></span>2007/9/30, shahzad bhatti :<span class="q"><br>> I am trying to build a Linda like tuple space in Erlang and though my simple
<br>> application is using ets for now, but I would like to use Mnesia to store<br>> tuples directly to take leverage of its replication and transactions<br>> capabilities. Since, Mnesia supports multiple tables that map to records, is
<br>> it possible to use tuples directly. Also, if anyone can suggest anything<br>> that will make it easier to implement tuplespace with blocking get/read<br>> operations. Thanks in advance.<br>><br>><br>>
<br>> ________________________________<br>> Pinpoint customers who are looking for what you sell.<br>><br>><br>> _______________________________________________<br>> erlang-questions mailing
list<br>> <a href="mailto:erlang-questions@erlang.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">erlang-questions@erlang.org</a><br>> <a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>><br></span></blockquote><span class="ad"><br><p>
</p><hr size="1">Luggage? GPS? Comic books? <br>
Check out fitting <a href="http://us.rd.yahoo.com/evt=48249/*http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> gifts for grads
</a> at Yahoo! Search.<p></p></span><br>_______________________________________________<br>erlang-questions mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:erlang-questions@erlang.org">
erlang-questions@erlang.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions
</a><br></blockquote></div><br>