"raw" or "verbatim" PIDs?

Michael McDaniel erlang@REDACTED
Fri Jul 7 01:31:33 CEST 2006


On Thu, Jul 06, 2006 at 01:40:45PM -0700, Jon Slenk wrote:
> (I've been Googling and looking through the archives, but haven't hit an 
> explanation/answer so far.)
> 
> I'm very new to Erlang, I'm just working my way through a tutorial. I 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Congratulations, and Welcome!

~~M

> spawned a process and was told that it has PID <0.47.0>, but I failed to 
> assign that to a variable. Now, is there any way I can send a message to 
> that PID by using the "raw" ID? I tried writing stuff like "<0.47.0> ! 
> foobar." or "0.47.0 ! foobar." in an attempt to mimic the code I've seen 
> where people write something like "ThePid = spawn(...). ThePid ! foobar." 
> However, the Erlang shell did not like my attempts :-) Is there a way to 
> use "raw" PIDs, or must it be stored in a variable?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  try, for example, ...

       list_to_pid("<0.47.0>") ! foobar


~~Michael

> 
> many thanks,
> -Jon.



More information about the erlang-questions mailing list