Your options are: propery lists and records. Records are faster, propery lists are more flexible.<br><br><br>Sergej<br><br><div class="gmail_quote">On Sun, Sep 18, 2011 at 9:10 AM, Jovi Zhang <span dir="ltr"><<a href="mailto:bookjovi@gmail.com">bookjovi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
Is there any good way to handle complicated data structure like C in Erlang?<br>
<br>
struct packet_t {<br>
int a,<br>
double b,<br>
struct xx_t,<br>
union c {int d, char e},<br>
char f:1,<br>
char g:3,<br>
char h:5<br>
}<br>
<br>
Some protocol have complicated data structure like above, how to<br>
represent those structure in Erlang? and operate on each field freely<br>
like C?<br>
<br>
.jovi<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" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br>