31
31
<p>This document describes the changes made to the Compiler
34
<section><title>Compiler 4.8</title>
36
<section><title>Fixed Bugs and Malfunctions</title>
40
Add '-callback' attributes in stdlib's behaviours</p>
42
Replace the behaviour_info(callbacks) export in stdlib's
43
behaviours with -callback' attributes for all the
44
callbacks. Update the documentation with information on
45
the callback attribute Automatically generate
46
'behaviour_info' function from '-callback' attributes</p>
48
'behaviour_info(callbacks)' is a special function that is
49
defined in a module which describes a behaviour and
50
returns a list of its callbacks.</p>
52
This function is now automatically generated using the
53
'-callback' specs. An error is returned by lint if user
54
defines both '-callback' attributes and the
55
behaviour_info/1 function. If no type info is needed for
56
a callback use a generic spec for it. Add '-callback'
57
attribute to language syntax</p>
59
Behaviours may define specs for their callbacks using the
60
familiar spec syntax, replacing the '-spec' keyword with
61
'-callback'. Simple lint checks are performed to ensure
62
that no callbacks are defined twice and all types
63
referred are declared.</p>
65
These attributes can be then used by tools to provide
66
documentation to the behaviour or find discrepancies in
67
the callback definitions in the callback module.</p>
69
Add callback specs into 'application' module in kernel
70
Add callback specs to tftp module following internet
71
documentation Add callback specs to inets_service module
72
following possibly deprecated comments</p>
78
The calculation of the 'uniq' value for a fun (see
79
<c>erlang:fun_info/1</c>) was too weak and has been
80
strengthened. It used to be based on the only the code
81
for the fun body, but it is now based on the MD5 of the
82
BEAM code for the module.</p>
90
<section><title>Improvements and New Features</title>
93
<p>Variables are now now allowed in '<c>fun M:F/A</c>' as
94
suggested by Richard O'Keefe in EEP-23.</p>
95
<p>The representation of '<c>fun M:F/A</c>' in the
96
abstract format has been changed in an incompatible way.
97
Tools that directly read or manipulate the abstract
98
format (such as parse transforms) may need to be updated.
99
The compiler can handle both the new and the old format
100
(i.e. extracting the abstract format from a pre-R15 BEAM
101
file and compiling it using compile:forms/1,2 will work).
102
The <c>syntax_tools</c> application can also handle both
105
*** POTENTIAL INCOMPATIBILITY ***</p>
111
<c>filename:find_src/1,2</c> will now work on stripped
112
BEAM files (reported by Per Hedeland). The HiPE compiler
113
will also work on stripped BEAM files. The BEAM compiler
114
will no longer include compilation options given in the
115
source code itself in <c>M:module_info(compile)</c>
116
(because those options will be applied anyway if the
117
module is re-compiled).</p>
122
<p>Inlining binary matching could cause an internal
123
compiler error. (Thanks to Rene Kijewski for reporting
133
<section><title>Compiler 4.7.5</title>
135
<section><title>Fixed Bugs and Malfunctions</title>
139
Compiler options given in the source code using a
140
<c>-compile()</c> attribute used to be included twice in
141
<c>Mod:module_info(compile)</c>. They are now only
142
included once at the beginning of the list of options.</p>
148
beam_disasm: Handle stripped BEAM files</p>
150
beam_disasm:file/1 would crash if asked to disassemble a
151
stripped BEAM file without an "Attr" chunk. (Thanks to
161
<section><title>Compiler 4.7.4</title>
163
<section><title>Fixed Bugs and Malfunctions</title>
167
If a variable is matched out in binary matching and used
168
as the size for a binary element, it would seem to be
169
unbound if used in a subsequent match operation. (Thanks
170
to Bernard Duggan.)</p>
175
<p>Eliminate incorrect warning in
176
<c>sys_core_fold</c></p>
185
<section><title>Compiler 4.7.3</title>
187
<section><title>Fixed Bugs and Malfunctions</title>
191
The <c>-export_type()</c> directive is no longer included
192
among the attributes.</p>
200
<section><title>Improvements and New Features</title>
204
The maximum number of allowed arguments for an Erlang
205
function has been lowered from 256 to 255, so that the
206
number of arguments can now fit in a byte.</p>
212
Dependency generation for Makefiles has been added to the
213
compiler and erlc. See the manual pages for
214
<c>compile</c> and <c>erlc</c>. (Thanks to Jean-Sebastien
34
224
<section><title>Compiler 4.7.2</title>
36
226
<section><title>Fixed Bugs and Malfunctions</title>