[erlang-questions] Embed a pid into string to be dynamically compiled

Vlad Dumitrescu <>
Thu Apr 18 09:56:03 CEST 2013


Hi,

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.

Usually there are simpler ways to solve problems than dynamically compiling
code, but it depends a lot on your use case.

regards,
Vlad



On Thu, Apr 18, 2013 at 9:48 AM, Martin Dimitrov <>wrote:

> Unfortunately not. The function is called from some macros and the
> function is either a do-nothing one or compiled to use the Pid.
>
> Martin
>
> On 4/18/2013 10:44 AM, Bengt Kleberg wrote:
> > Greetings,
> >
> > Would it be possible for you to build the module with an interface
> > function that accepts the pid as its argument?
> >
> >
> > bengt
> >
> > On Thu, 2013-04-18 at 10:38 +0300, Martin Dimitrov wrote:
> >> Hello,
> >>
> >> I need to build dynamically a module. Inside one of its functions, it
> >> has to send a message to Pid. How to compile it? The easiest solution I
> >> can think of is to do pid_to_list(Pid) and inside the function Pid =
> >> list_to_pid("<0.22.0>") but I really would like to avoid these extra
> >> operations.
> >>
> >> Thanks,
> >>
> >> Martin
> >> _______________________________________________
> >> erlang-questions mailing list
> >> 
> >> http://erlang.org/mailman/listinfo/erlang-questions
> >
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130418/1bfdb36e/attachment.html>


More information about the erlang-questions mailing list