Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why does Erlang print “ok” after my programs output?

Erlang Ok output print program
0
Posted

Why does Erlang print “ok” after my programs output?

0

The Erlang shell works by reading an Erlang expression, evaluating it, printing the result and looping for another expression, i.e. a REPL shell. The io:fwrite() function does two things. It prints out “hello world” and it returns the value ok. So, when you execute io:fwrite(“hello, world\n”) in the shell, the fwrite function prints the first line and the shell prints the return value, ok. This can be avoided by running Erlang without a shell.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123