why does the process dictionary have a bad rep?

Sean Hinde <>
Fri Jul 15 17:52:14 CEST 2005


It is possible to model a global variable using a named process. A  
set and get synchronous call (i.e. message passing) API would update  
the state of the named process.

Sean

On 15 Jul 2005, at 16:18, ke.han wrote:

> This thread is talking about two things: abuse of the proc dict and  
> abuse of message passing.
> I understand the example of using the proc dict to get around  
> single assignment.  You guys have lost me on the second part.
> Can someone give an example of message passing abuse?  What does  
> message passing have to do with variable assignment?
> thanks, ke han
>
>
> Ulf Wiger wrote:
>
>> Den 2005-07-15 11:09:36 skrev Matthias Lang <>:
>>
>>> Valentin Micic writes:
>>>
>>> [about the process dictionary]
>>>  > has to reply with message. What are the limitations of  
>>> dictionary,  and *why*
>>>  > it received a bad reputation?
>>>
>>> In addition to the points already made, another reason is that a
>>> significant proportion of those who haven't seen single-assignment
>>> before will seize upon anything which "finally lets me assign to a
>>> damn variable like I want to", and the first 'anything' they usually
>>> encounter is the process dictionary.
>>>
>>> (ab)using processes and message passing to achieve the same  
>>> effect at
>>> least has the side effect of teaching them about message passing.
>>>
>> Agreed. The problem isn't that we shouldn't caution about use
>> of the process dictionary. We should do so in a way that people
>> get a chance to learn why it should be used with care, and what
>> else should be used with care.
>> I have yet to find the chapter that explains this.
>> Erlang has a pragmatic approach to message passing (no monads,
>> etc.) This is wonderful in many ways, but it also introduces
>> some juicy opportunities to write terrible code.
>> /Uffe
>>
>
>




More information about the erlang-questions mailing list