Hi,<div>You are right. I don't know what I did. Your code works.</div><div><br></div><div>Thanks.</div><div><br><br><div class="gmail_quote">2012/8/2 Vlad Dumitrescu <span dir="ltr"><<a href="mailto:vladdu55@gmail.com" target="_blank">vladdu55@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<div class="im"><br>
On Thu, Aug 2, 2012 at 10:48 AM, Pablo Vieytes <<a href="mailto:pablo.vb80@gmail.com">pablo.vb80@gmail.com</a>> wrote:<br>
> This DOESN'T work -><br>
><br>
> parent() -><br>
>      Args = data,<br>
>      spawn(fun() -> son(Args) end).<br>
><br>
> son(Args) -><br>
>     %%some code -> NewData<br>
>      ReplyTo = self(),<br>
>      AnotherProcess ! {ReplyTo, NewData}.<br>
><br>
> ReplyTo has the pid of process who is running parent fun and I want the pid<br>
> of the new process spawned with the son fun.<br>
<br>
</div>It does work, maybe there is something else creating trouble?<br>
<br>
parent() -><br>
        io:format("P:~p~n", [self()]),<br>
        Args = data,<br>
        C = spawn(fun() -> son(Args) end),<br>
        io:format("C:~p~n", [C]).<br>
<br>
son(_Args) -><br>
         ReplyTo = self(),<br>
         io:format("X:~p~n", [ReplyTo]).<br>
<br>
gives the output<br>
<br>
4> main:parent().<br>
P:<0.102.0><br>
C:<0.122.0><br>
X:<0.122.0><br>
ok<br>
<br>
regards,<br>
Vlad<br>
</blockquote></div><br></div>