~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/compiler/src/erl_bifs.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
%%      affect the state, nor depend on the state, although its
32
32
%%      evaluation is not guaranteed to complete normally for all input.
33
33
 
34
 
-spec(is_pure/3 :: (atom(), atom(), byte()) -> bool()).
 
34
-spec is_pure(atom(), atom(), byte()) -> bool().
35
35
 
36
36
is_pure(erlang, '*', 2) -> true;
37
37
is_pure(erlang, '+', 1) -> true;    % (even for non-numbers)
65
65
is_pure(erlang, atom_to_list, 1) -> true;
66
66
is_pure(erlang, binary_to_list, 1) -> true;
67
67
is_pure(erlang, binary_to_list, 3) -> true;
 
68
is_pure(erlang, bit_size, 1) -> true;
 
69
is_pure(erlang, byte_size, 1) -> true;
68
70
is_pure(erlang, concat_binary, 1) -> true;
69
71
is_pure(erlang, element, 2) -> true;
70
72
is_pure(erlang, float, 1) -> true;
104
106
is_pure(erlang, term_to_binary, 1) -> true;
105
107
is_pure(erlang, tl, 1) -> true;
106
108
is_pure(erlang, trunc, 1) -> true;
 
109
is_pure(erlang, tuple_size, 1) -> true;
107
110
is_pure(erlang, tuple_to_list, 1) -> true;
108
111
is_pure(lists, append, 2) -> true;
109
112
is_pure(lists, subtract, 2) -> true;
144
147
%%      Note: is_function/2 and is_record/3 are NOT safe: is_function(X, foo)
145
148
%%      and is_record(X, foo, bar) will fail.
146
149
 
147
 
-spec(is_safe/3 :: (atom(), atom(), byte()) -> bool()).
 
150
-spec is_safe(atom(), atom(), byte()) -> bool().
148
151
 
149
152
is_safe(erlang, '/=', 2) -> true;
150
153
is_safe(erlang, '<', 2) -> true;
185
188
is_safe(erlang, self, 0) -> true;
186
189
is_safe(erlang, term_to_binary, 1) -> true;
187
190
is_safe(erlang, time, 0) -> true;
 
191
is_safe(error_logger, warning_map, 0) -> true;
188
192
is_safe(_, _, _) -> false.
189
193
 
190
194
 
198
202
%%      normally, i.e., if it always causes an exception regardless of
199
203
%%      its arguments.
200
204
 
201
 
-spec(is_exit_bif/3 :: (atom(), atom(), byte()) -> bool()).
 
205
-spec is_exit_bif(atom(), atom(), byte()) -> bool().
202
206
 
203
207
is_exit_bif(erlang, exit, 1) -> true;
204
208
is_exit_bif(erlang, throw, 1) -> true;