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

mats cronqvist masse@REDACTED
Tue Dec 16 23:31:36 CET 2008


Eric Holbrook <subopt@REDACTED> writes:

> 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.

  pardon me for pointing out the obvious, but are you sure that 
sets:to_list(Set) =/= [] ?



More information about the erlang-questions mailing list