[erlang-questions] io:format problem within a process, but not in the shell

Eric Holbrook <>
Tue Dec 16 16:27:42 CET 2008


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



More information about the erlang-questions mailing list