I see what you mean. For me it seems a little bit too heavy weapon for my little task. But thank you Max - it is good to know some cool techniques!<div><br></div><div>After some consideration for me it seems it makes sense to create a process (gen_server) that will hold the range-list inside its state and call it every time I need to find out my current index.<br>

<div><br><br><div class="gmail_quote">On Tue, Nov 15, 2011 at 4:34 PM, Max Lapshin <span dir="ltr"><<a href="mailto:max.lapshin@gmail.com">max.lapshin@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 class="im">On Tue, Nov 15, 2011 at 4:31 PM, Max Bourinov <<a href="mailto:bourinov@gmail.com">bourinov@gmail.com</a>> wrote:<br>
>>>Compile dynamic module<br>
> Max, can you point me to docs where I can read more about this?<br>
<br>
</div><a href="https://github.com/erlyvideo/http_router/blob/master/src/http_router_compiler.erl" target="_blank">https://github.com/erlyvideo/http_router/blob/master/src/http_router_compiler.erl</a><br>
<a href="https://github.com/ahmednawras/log4erl/blob/master/src/log_filter_codegen.erl" target="_blank">https://github.com/ahmednawras/log4erl/blob/master/src/log_filter_codegen.erl</a><br>
<br>
or something else like this<br>
</blockquote></div><br></div></div>