<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 20, 2015 at 5:42 PM, Sid Muller <span dir="ltr"><<a href="mailto:sid5@gmx.us" target="_blank">sid5@gmx.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there a way to do a select on a bitstring based on a value in ets table?<br>
The X:'$2'/bitstring below results in an illegal bit size, which makes sense because '$2' doesn't exits yet.<br>
<br>
How do I dynamically create that X value based on external B value and '$2' that will be selected from ets table? Is that even possible?<br></blockquote><div><br></div><div>As far as I know, it is not possible. Match specs, as you may have noticed, do not have a lot of support for working with binaries, and even if you substitute your binary to a list, it is not possible to do what you want to do. The language is (afaik) not powerful enough to express that kind of logic.</div><div><br></div><div>If you know the length of the prefix beforehand, you could do it, but if you don't then it becomes very hard/impossible to do with what is allowed in match specs today.</div><div><br></div><div>Lukas</div><div><br></div></div></div></div>