# lib

### MODULE

lib

### MODULE SUMMARY

Interface Module

### DESCRIPTION

The module `lib` provides the following useful library functions.

### EXPORTS

`flush_receive() -> void()`

Flushes the message buffer of the current process.

`error_message(Format, Args)`

Prints error message `Args` in accordance with `Format` in the normal way.

`progname() -> atom()`

Returns the name of the script that starts the current Erlang session.

`nonl(List1)`

Removes the last newline character, if any, in `List`.

`send(To, Msg)`

This function to makes it possible to send a message through `apply`.

`sendw(To, Msg)`

As `send/2`, but waits for an answer. It is implemented as follows:

      sendw(To, Msg) ->
        To ! {self(),Msg},
        receive
          Reply -> Reply
        end.

The message returned is not necessarily a reply to the message sent.

### Warning

This module is retained for compatibility. It may disappear without warning in a future release.

### AUTHORS

Robert Virding - support@erlang.ericsson.se

stdlib 1.13.8
Copyright © 1991-2005 Ericsson AB