[erlang-questions] io:format problem within a process, but not in the shell
Eric Holbrook
subopt@REDACTED
Tue Dec 16 16:54:38 CET 2008
If you are right, then why does the list comprehension line work in the
shell, but not within the context of the process? I don't understand how
the context determines the validity or behavior of that particular syntax.
thanks,
Eric
tuscland@REDACTED wrote:
> Maybe I'm not correct but I think, this because you are creating a
> list as a second statement instead of printing the list in the first
> io:format statement.
>
>
> On 12/16/08, Eric Holbrook <subopt@REDACTED> wrote:
>
>> Why doesn't *all* of my io:format code work w/in the context of my
>> process?
>>
>>
>> <code>
>>
>> setMgr( Set ) ->
>> receive
>> {repr} ->
>> io:format("Set elements: ~n"),
>> [io:format(" ~p~n", [Elem]) || Elem <- sets:to_list(Set)],
>> setMgr(Set);
>> {other various blocks to add/modify my internal set 'Set'} ->
>> ...
>> end.
>>
>> </code>
>>
>> When i send the {repr} msg to a 'setMgr' process, i get the 'Set
>> elements' output, but somehow the list comprehension part doesn't show
>> up in STDOUT.
>>
>> However, if i create a set named Set in the shell, and execute the
>> list comprehension line, it works fine.
>>
>> tia,
>> Eric
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://www.erlang.org/mailman/listinfo/erlang-questions
>>
>>
>
>
More information about the erlang-questions
mailing list