<div dir="ltr">Hi,<div><br></div><div style>If it's a globally known process that you want to send to, then you should probably register a name for it and use that instead of the pid. </div><div style><br></div><div style>
Usually there are simpler ways to solve problems than dynamically compiling code, but it depends a lot on your use case. </div><div style><br></div><div style>regards,</div><div style>Vlad</div><div style><br></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 18, 2013 at 9:48 AM, Martin Dimitrov <span dir="ltr"><<a href="mailto:mrtndimitrov@gmail.com" target="_blank">mrtndimitrov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Unfortunately not. The function is called from some macros and the<br>
function is either a do-nothing one or compiled to use the Pid.<br>
<span class="HOEnZb"><font color="#888888"><br>
Martin<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 4/18/2013 10:44 AM, Bengt Kleberg wrote:<br>
> Greetings,<br>
><br>
> Would it be possible for you to build the module with an interface<br>
> function that accepts the pid as its argument?<br>
><br>
><br>
> bengt<br>
><br>
> On Thu, 2013-04-18 at 10:38 +0300, Martin Dimitrov wrote:<br>
>> Hello,<br>
>><br>
>> I need to build dynamically a module. Inside one of its functions, it<br>
>> has to send a message to Pid. How to compile it? The easiest solution I<br>
>> can think of is to do pid_to_list(Pid) and inside the function Pid =<br>
>> list_to_pid("<0.22.0>") but I really would like to avoid these extra<br>
>> operations.<br>
>><br>
>> Thanks,<br>
>><br>
>> Martin<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>
><br>
<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>
</div></div></blockquote></div><br></div>