<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div>I want to look at the closure code to investigate some stupid compiler tricks.</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">Best,</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">Thomas</div><div class="yahoo_quoted" style="display: block;"> <br> <br> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> On Tuesday, December 3, 2013 1:30 PM, Anthony Ramine <n.oxyde@gmail.com> wrote:<br> </font> </div> <blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div class="y_msg_container">No there isn’t.<br clear="none"><br clear="none">Why do you need that, out of curiosity?<br clear="none"><br clear="none">-- <br clear="none">Anthony Ramine<br clear="none"><div class="yqt1160315125" id="yqtfd91655"><br clear="none">Le 3 déc. 2013 à 13:14, Thomas Lindgren <<a shape="rect" ymailto="mailto:thomasl_erlang@yahoo.com" href="mailto:thomasl_erlang@yahoo.com">thomasl_erlang@yahoo.com</a>> a écrit :<br clear="none"><br clear="none">> Hi guys,<br clear="none">> <br clear="none">> Before I start hacking on something, I thought I'd ask whether there already is a standard way to get the original code from a compiled
fun/closure. (I know you can get it for interpreted funs by using fun_info.)<br clear="none">> <br clear="none">> E.g., for code like this:<br clear="none">> <br clear="none">> -module(a). <br clear="none">> -compile(export_all).<br clear="none">> adder(N) -> fun(X) X+N end.<br clear="none">> <br clear="none">> I'd like to be able to write something like this:<br clear="none">> <br clear="none">> > c(a), F = a:adder(3), magic:get_code(F).<br clear="none">> {fun, 0, [{clause, 0, [{var, 0, 'X'}], [], [{op, '+', {var, 0,'X'},{var,0,'N'}}]}], [{'N', 3}]} %% AST of fun F with free var env<br clear="none">> <br clear="none">> Or the equivalent.<br clear="none">> <br clear="none">> Best,<br clear="none">> Thomas</div><br clear="none">> <br clear="none">> _______________________________________________<br clear="none">> erlang-questions mailing list<br clear="none">> <a shape="rect"
ymailto="mailto:erlang-questions@erlang.org" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br clear="none">> <a shape="rect" href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><div class="yqt1160315125" id="yqtfd03846"><br clear="none"></div><br><br></div> </blockquote> </div> </div> </div> </div></body></html>