<div dir="ltr">Hi,<div><br></div><div>Tools dedicated to generate Erlang code are the erl_{scan,parse,syntax} and compile modules.</div><div>However, in order to build and load code at runtime one is forced to put one's code into a module and then an exported function.</div>
<div><br></div><div>Is it not possible to build and load small pieces of code, such as fun expressions or a list of atoms, without the constraint of being inside a thus generated module/exported function?</div><div><br></div>
<div>I imagine it must go against some Erlang rules (wouldn't it be considered global state?),</div><div>but it somehow feels cleaner than to have to generate a module and export a function just to access runtime-variable code.</div>
<div><br></div><div>(What I am actually doing is scanning & parsing a "query string" then building a list comprehension out of it, then executing the LC. Thus the need for a runtime-generated fun-expr).</div>
<div><br></div><div>Pierre</div></div>