[erlang-questions] Process scope variable

Dan Gudmundsson dangud@REDACTED
Tue Feb 17 15:17:04 CET 2015


Hmm missed something there didn't I..

With funs you can do:

a() ->
   A = 10,
   B = fun() -> A + 1 end,
   B().



On Tue, Feb 17, 2015 at 3:11 PM, Dan Gudmundsson <dangud@REDACTED> wrote:

> Why not
>
> a() -> 10.
>
> b() -> a() + 1.
>
> On Tue, Feb 17, 2015 at 3:00 PM, Imants Cekusins <imantc@REDACTED> wrote:
>
>> > process global variables can be set by erlang:put() and can be read by
>> erlang:get().
>>
>> cheers for the hint ;)
>>
>> I'll try it and see if it makes life any easier.
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150217/8b638b37/attachment.htm>


More information about the erlang-questions mailing list