<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1597" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=864243712-17102007><FONT face=Arial color=#0000ff
size=2>Normally you never use the process dictionary. You could use a named ets
table instead but there are very very few</FONT></SPAN></DIV>
<DIV><SPAN class=864243712-17102007><FONT face=Arial color=#0000ff
size=2>situations where you actually need either of those.</FONT></SPAN></DIV>
<DIV><SPAN class=864243712-17102007><FONT face=Arial color=#0000ff size=2>Most
of the time there is some sort of main loop where the code is executed. The
input data to the loop function</FONT></SPAN></DIV>
<DIV><SPAN class=864243712-17102007><FONT face=Arial color=#0000ff size=2>is the
place to use as storage for any data you need to keep.</FONT> </SPAN></DIV>
<DIV><SPAN class=864243712-17102007><FONT face=Arial color=#0000ff
size=2>/OLA.</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT><BR> </DIV>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> erlang-questions-bounces@erlang.org
[mailto:erlang-questions-bounces@erlang.org] <B>On Behalf Of
</B>YC<BR><B>Sent:</B> den 17 oktober 2007 07:03<BR><B>To:</B> Erlang
Questions<BR><B>Subject:</B> [erlang-questions] *current*
value?<BR></FONT><BR></DIV>
<DIV></DIV>Hi all - <BR><BR>Is process dictionary the only built-in language
level facility to return context-dependent data, in Erlang? e.g., self()
returns the "current" process.<BR><BR>%% hopefully only assign
once...<BR>set_current_request(Req) -><BR> set(current_request,
Req).<BR><BR>%% retrieve the request. <BR>current_request() -><BR>
get(current_request).<BR><BR>Please let me know if there are better ways of
accomplishing the
goal.<BR>Thanks,<BR>yc<BR><BR><BR><BR></BLOCKQUOTE></BODY></HTML>