aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/doc/src/lib.xml
blob: 7aabb4bea8f600430387e5d0376624b401614e76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>1996</year><year>2016</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    
    </legalnotice>

    <title>lib</title>
    <prepared></prepared>
    <docno></docno>
    <date></date>
    <rev></rev>
  </header>
  <module>lib</module>
  <modulesummary>Useful library functions.</modulesummary>
  <description>
    <warning>
      <p>This module is retained for backward compatibility. It can disappear
        without warning in a future Erlang/OTP release.</p>
    </warning>
  </description>

  <funcs>
    <func>
      <name name="error_message" arity="2"/>
      <fsummary>Print error message.</fsummary>
      <desc>
        <p>Prints error message <c><anno>Args</anno></c> in accordance with
          <c><anno>Format</anno></c>. Similar to
          <seealso marker="io#format/1"><c>io:format/2</c></seealso>.</p>
      </desc>
    </func>

    <func>
      <name name="flush_receive" arity="0"/>
      <fsummary>Flush messages.</fsummary>
      <desc>
        <p>Flushes the message buffer of the current process.</p>
      </desc>
    </func>

    <func>
      <name name="progname" arity="0"/>
      <fsummary>Return name of Erlang start script.</fsummary>
      <desc>
        <p>Returns the name of the script that started the current
          Erlang session.</p>
      </desc>
    </func>

    <func>
      <name name="send" arity="2"/>
      <fsummary>Send a message.</fsummary>
      <desc>
        <p>Makes it possible to send a message using the <c>apply/3</c> BIF.</p>
      </desc>
    </func>

    <func>
      <name name="sendw" arity="2"/>
      <fsummary>Send a message and wait for an answer.</fsummary>
      <desc>
        <p>As <seealso marker="#send/2"><c>send/2</c></seealso>,
          but waits for an answer. It is implemented as follows:</p>
        <code type="none">
sendw(To, Msg) ->
    To ! {self(),Msg},
    receive
        Reply -> Reply
    end.</code>
        <p>The returned message is not necessarily a reply to the sent
          message.</p>
      </desc>
    </func>
  </funcs>
</erlref>